summaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-03-17 22:22:06 -0700
committerJunio C Hamano <gitster@pobox.com>2011-03-17 22:22:06 -0700
commitb9b3eef76186d423efb684d01b3e99ef010a61de (patch)
treef839064d11cf5af7b0839ccbabee3bd645747904 /merge-recursive.c
parentb2c8c0a762745768e8fb249949801c1aed8f7c1d (diff)
downloadgit-b9b3eef76186d423efb684d01b3e99ef010a61de.tar.gz
merge-recursive: tweak magic band-aid
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>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index 847bc8494f..59482ffc87 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -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*/);