Skip to content

Commit

Permalink
merge-recursive: tweak magic band-aid
Browse files Browse the repository at this point in the history
Running checks against working tree (e.g. lstat()) and causing
changes to working tree (e.g. unlink()) while building a virtual
ancestor merge does not make any sense. Avoid doing so.

This is not a real fix; it is another magic band-aid on top of
another band-aid we placed earlier.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Mar 18, 2011
1 parent b2c8c0a commit b9b3eef
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion merge-recursive.c
Original file line number Diff line number Diff line change
@@ -370,6 +370,13 @@ static void make_room_for_directories_of_df_conflicts(struct merge_options *o,
struct stage_data *last_e;
int i;

/*
* Do not do any of this crazyness during the recursive; we don't
* even write anything to the working tree!
*/
if (o->call_depth)
return;

for (i = 0; i < entries->nr; i++) {
const char *path = entries->items[i].string;
int len = strlen(path);
@@ -1274,7 +1281,7 @@ static int merge_content(struct merge_options *o,

if (mfi.clean && !df_conflict_remains &&
sha_eq(mfi.sha, a_sha) && mfi.mode == a.mode &&
lstat(path, &st) == 0) {
!o->call_depth && !lstat(path, &st)) {
output(o, 3, "Skipped %s (merged same as existing)", path);
add_cacheinfo(mfi.mode, mfi.sha, path,
0 /*stage*/, 1 /*refresh*/, 0 /*options*/);

0 comments on commit b9b3eef

Please sign in to comment.