X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=merge-recursive.c;h=ee853b990d8bfb15e0058fefbbd267bd58ed40fc;hb=4c58a7111d9fb4f62ca041fc73e8aec0a2f9c800;hp=2da4333439d01d29365d150aed3156aceb0cfbd9;hpb=4c6e8aa8f001fa9619dc891c501d0d4389583353;p=git.git diff --git a/merge-recursive.c b/merge-recursive.c index 2da433343..ee853b990 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -237,7 +237,7 @@ static int save_files_dirs(const unsigned char *sha1, string_list_insert(newpath, &o->current_file_set); free(newpath); - return READ_TREE_RECURSIVE; + return (S_ISDIR(mode) ? READ_TREE_RECURSIVE : 0); } static int get_files_dirs(struct merge_options *o, struct tree *tree) @@ -934,6 +934,11 @@ static int process_renames(struct merge_options *o, ren1_src, ren1_dst, branch1, branch2); update_file(o, 0, ren1->pair->two->sha1, ren1->pair->two->mode, ren1_dst); + update_stages(ren1_dst, NULL, + branch1 == o->branch1 ? + ren1->pair->two : NULL, + branch1 == o->branch1 ? + NULL : ren1->pair->two, 1); } else if (!sha_eq(dst_other.sha1, null_sha1)) { const char *new_path; clean_merge = 0;