Skip to content

Commit b5b4250

Browse files
author
Linus Torvalds
committed
git-read-tree: make one-way merge also honor the "update" flag
It didn't set CE_UPDATE before, so "-u" was a no-op.
1 parent ccef66b commit b5b4250

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

read-tree.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,11 @@ static int oneway_merge(struct cache_entry **src, struct cache_entry **dst)
218218

219219
if (!a)
220220
return 0;
221-
if (old && same(old, a))
222-
*a = *old;
223-
a->ce_flags &= ~htons(CE_STAGEMASK);
224-
*dst++ = a;
225-
return 1;
221+
if (old && same(old, a)) {
222+
*dst++ = old;
223+
return 1;
224+
}
225+
return merged_entry(a, NULL, dst);
226226
}
227227

228228
static void check_updates(struct cache_entry **src, int nr)

0 commit comments

Comments
 (0)