Skip to content

Commit

Permalink
Merge branch 'js/maint-merge-recursive-r-d-conflict'
Browse files Browse the repository at this point in the history
* js/maint-merge-recursive-r-d-conflict:
  merge-recursive: mark rename/delete conflict as unmerged
  • Loading branch information
Junio C Hamano committed Jan 7, 2009
2 parents 4c6e8aa + 36e3b5e commit ff32340
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
5 changes: 5 additions & 0 deletions merge-recursive.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
23 changes: 23 additions & 0 deletions t/t6024-recursive-merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,27 @@ test_expect_success 'refuse to merge binary files' '
merge.err
'

test_expect_success 'mark rename/delete as unmerged' '
git reset --hard &&
git checkout -b delete &&
git rm a1 &&
test_tick &&
git commit -m delete &&
git checkout -b rename HEAD^ &&
git mv a1 a2
test_tick &&
git commit -m rename &&
test_must_fail git merge delete &&
test 1 = $(git ls-files --unmerged | wc -l) &&
git rev-parse --verify :2:a2 &&
test_must_fail git rev-parse --verify :3:a2 &&
git checkout -f delete &&
test_must_fail git merge rename &&
test 1 = $(git ls-files --unmerged | wc -l) &&
test_must_fail git rev-parse --verify :2:a2 &&
git rev-parse --verify :3:a2
'

test_done

0 comments on commit ff32340

Please sign in to comment.