Skip to content

Commit 2d0029e

Browse files
committed
Merge branch 'mz/oneway-merge-wo-u-no-lstat'
Optimize "read-tree -m <tree-ish>" without "-u". * mz/oneway-merge-wo-u-no-lstat: oneway_merge(): only lstat() when told to update worktree
2 parents 1fd365d + 686b2de commit 2d0029e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

unpack-trees.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1834,7 +1834,7 @@ int oneway_merge(struct cache_entry **src, struct unpack_trees_options *o)
18341834

18351835
if (old && same(old, a)) {
18361836
int update = 0;
1837-
if (o->reset && !ce_uptodate(old) && !ce_skip_worktree(old)) {
1837+
if (o->reset && o->update && !ce_uptodate(old) && !ce_skip_worktree(old)) {
18381838
struct stat st;
18391839
if (lstat(old->name, &st) ||
18401840
ie_match_stat(o->src_index, old, &st, CE_MATCH_IGNORE_VALID|CE_MATCH_IGNORE_SKIP_WORKTREE))

0 commit comments

Comments
 (0)