1
0
mirror of https://github.com/git/git.git synced 2024-11-18 21:43:58 +01:00

Merge branch 'jc/lstat'

* jc/lstat:
  diff-files: mark an index entry we know is up-to-date as such
  write_index(): optimize ce_smudge_racily_clean_entry() calls with CE_UPTODATE
This commit is contained in:
Junio C Hamano 2008-05-05 19:16:26 -07:00
commit 867fa20fe9
2 changed files with 6 additions and 3 deletions

@ -479,8 +479,11 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
continue; continue;
} }
changed = ce_match_stat(ce, &st, ce_option); changed = ce_match_stat(ce, &st, ce_option);
if (!changed && !DIFF_OPT_TST(&revs->diffopt, FIND_COPIES_HARDER)) if (!changed) {
continue; ce_mark_uptodate(ce);
if (!DIFF_OPT_TST(&revs->diffopt, FIND_COPIES_HARDER))
continue;
}
oldmode = ce->ce_mode; oldmode = ce->ce_mode;
newmode = ce_mode_from_stat(ce, st.st_mode); newmode = ce_mode_from_stat(ce, st.st_mode);
diff_change(&revs->diffopt, oldmode, newmode, diff_change(&revs->diffopt, oldmode, newmode,

@ -1370,7 +1370,7 @@ int write_index(const struct index_state *istate, int newfd)
struct cache_entry *ce = cache[i]; struct cache_entry *ce = cache[i];
if (ce->ce_flags & CE_REMOVE) if (ce->ce_flags & CE_REMOVE)
continue; continue;
if (is_racy_timestamp(istate, ce)) if (!ce_uptodate(ce) && is_racy_timestamp(istate, ce))
ce_smudge_racily_clean_entry(ce); ce_smudge_racily_clean_entry(ce);
if (ce_write_entry(&c, newfd, ce) < 0) if (ce_write_entry(&c, newfd, ce) < 0)
return -1; return -1;