Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Jun 13, 2014
  1. @pclouds @gitster

    read-cache: mark updated entries for split index

    pclouds authored gitster committed
    The large part of this patch just follows CE_ENTRY_CHANGED
    marks. replace_index_entry() is updated to update
    split_index->base->cache[] as well so base->cache[] does not reference
    to a freed entry.
    Signed-off-by: Nguyễn Thái Ngọc Duy <>
    Signed-off-by: Junio C Hamano <>
  2. @pclouds @gitster

    entry.c: update cache_changed if refresh_cache is set in checkout_ent…

    pclouds authored gitster committed
    Other fill_stat_cache_info() is on new entries, which should set
    CE_ENTRY_ADDED in cache_changed, so we're safe.
    Signed-off-by: Nguyễn Thái Ngọc Duy <>
    Signed-off-by: Junio C Hamano <>
Commits on Oct 24, 2013
  1. @pclouds @gitster

    entry.c: convert checkout_entry to use strbuf

    pclouds authored gitster committed
    The old code does not do boundary check so any paths longer than
    PATH_MAX can cause buffer overflow. Replace it with strbuf to handle
    paths of arbitrary length.
    The OS may reject if the path is too long though. But in that case we
    report the cause (e.g. name too long) and usually move on to checking
    out the next entry.
    Signed-off-by: Nguyễn Thái Ngọc Duy <>
    Signed-off-by: Junio C Hamano <>
Commits on Jul 9, 2013
  1. @pclouds @gitster

    Convert "struct cache_entry *" to "const ..." wherever possible

    pclouds authored gitster committed
    I attempted to make index_state->cache[] a "const struct cache_entry **"
    to find out how existing entries in index are modified and where. The
    question I have is what do we do if we really need to keep track of on-disk
    changes in the index. The result is
     - diff-lib.c: setting CE_UPTODATE
     - name-hash.c: setting CE_HASHED
     - preload-index.c, read-cache.c, unpack-trees.c and
       builtin/update-index: obvious
     - entry.c: write_entry() may refresh the checked out entry via
       fill_stat_cache_info(). This causes "non-const struct cache_entry
       *" in builtin/apply.c, builtin/checkout-index.c and
     - builtin/ls-files.c: --with-tree changes stagemask and may set
    Of these, write_entry() and its call sites are probably most
    interesting because it modifies on-disk info. But this is stat info
    and can be retrieved via refresh, at least for porcelain
    commands. Other just uses ce_flags for local purposes.
    So, keeping track of "dirty" entries is just a matter of setting a
    flag in index modification functions exposed by read-cache.c. Except
    unpack-trees, the rest of the code base does not do anything funny
    behind read-cache's back.
    The actual patch is less valueable than the summary above. But if
    anyone wants to re-identify the above sites. Applying this patch, then
        diff --git a/cache.h b/cache.h
        index 430d021..1692891 100644
        --- a/cache.h
        +++ b/cache.h
        @@ -267,7 +267,7 @@ static inline unsigned int canon_mode(unsigned int mode)
         #define cache_entry_size(len) (offsetof(struct cache_entry,name) + (len) + 1)
         struct index_state {
        -	struct cache_entry **cache;
        +	const struct cache_entry **cache;
         	unsigned int version;
         	unsigned int cache_nr, cache_alloc, cache_changed;
         	struct string_list *resolve_undo;
    will help quickly identify them without bogus warnings.
    Signed-off-by: Nguyễn Thái Ngọc Duy <>
    Signed-off-by: Junio C Hamano <>
Commits on Nov 29, 2010
  1. @pclouds @gitster

    entry.c: remove "checkout-index" from error messages

    pclouds authored gitster committed
    Back then when entry.c was part of checkout-index (or checkout-cache
    at that time [1]). It makes sense to print the command name in error
    messages. Nowadays entry.c is in libgit and can be used by any
    commands, printing "git checkout-index: blah" does no more than
    confusion. The error messages without it still give enough information.
    [1] 12dccc1 (Make fiel checkout function available to the git library - 2005-06-05)
    Signed-off-by: Nguyễn Thái Ngọc Duy <>
    Acked-by: Jeff King <>
    Signed-off-by: Junio C Hamano <>
Commits on Dec 14, 2009
  1. @pclouds @gitster

    ie_match_stat(): do not ignore skip-worktree bit with CE_MATCH_IGNORE…

    pclouds authored gitster committed
    Previously CE_MATCH_IGNORE_VALID flag is used by both valid and
    skip-worktree bits. While the two bits have similar behaviour, sharing
    this flag means "git update-index --really-refresh" will ignore
    skip-worktree while it should not. Instead another flag is
    introduced to ignore skip-worktree bit, CE_MATCH_IGNORE_VALID only
    applies to valid bit.
    Signed-off-by: Nguyễn Thái Ngọc Duy <>
    Signed-off-by: Junio C Hamano <>
Something went wrong with that request. Please try again.