summaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2010-09-20 02:29:06 -0600
committerJunio C Hamano <gitster@pobox.com>2010-09-29 17:37:05 -0700
commit2adc7dcc111636ed16601dc7516ced1c5cfda088 (patch)
treed40b124b9f9be45e4b74c7991cbcc3bb32d2031b /merge-recursive.c
parenta0de2f6bd3b79f7ab61ea90f795b964a7f7f3d6d (diff)
downloadgit-2adc7dcc111636ed16601dc7516ced1c5cfda088.tar.gz
conflict_rename_rename_1to2(): Fix checks for presence of D/F conflicts
This function is called from process_df_entry(), near the end of the merge. Rather than just checking whether one of the sides of the merge had a directory at the same path as one of our files, check whether that directory is still present by this point of our merge. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index 09ce327c17..85d69eb567 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -841,17 +841,16 @@ static void conflict_rename_rename_1to2(struct merge_options *o,
const char *ren2_dst = pair2->two->path;
const char *dst_name1 = ren1_dst;
const char *dst_name2 = ren2_dst;
- if (string_list_has_string(&o->current_directory_set, ren1_dst)) {
+ struct stat st;
+ if (lstat(ren1_dst, &st) == 0 && S_ISDIR(st.st_mode)) {
dst_name1 = del[delp++] = unique_path(o, ren1_dst, branch1);
output(o, 1, "%s is a directory in %s adding as %s instead",
ren1_dst, branch2, dst_name1);
- remove_file(o, 0, ren1_dst, 0);
}
- if (string_list_has_string(&o->current_directory_set, ren2_dst)) {
+ if (lstat(ren2_dst, &st) == 0 && S_ISDIR(st.st_mode)) {
dst_name2 = del[delp++] = unique_path(o, ren2_dst, branch2);
output(o, 1, "%s is a directory in %s adding as %s instead",
ren2_dst, branch1, dst_name2);
- remove_file(o, 0, ren2_dst, 0);
}
if (o->call_depth) {
remove_file_from_cache(dst_name1);