Skip to content

Commit

Permalink
Merge branch 'jk/merge-tree-added-identically'
Browse files Browse the repository at this point in the history
off-by-one fix.

* jk/merge-tree-added-identically:
  merge-tree: fix typo in "both changed identically"
  • Loading branch information
gitster committed Apr 28, 2013
2 parents ea57352 + ab5f424 commit 27f0d3b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/merge-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ static void unresolved(const struct traverse_info *info, struct name_entry n[3])
static int threeway_callback(int n, unsigned long mask, unsigned long dirmask, struct name_entry *entry, struct traverse_info *info)
{
/* Same in both? */
if (same_entry(entry+1, entry+2) || both_empty(entry+0, entry+2)) {
if (same_entry(entry+1, entry+2) || both_empty(entry+1, entry+2)) {
/* Modified, added or removed identically */
resolve(info, NULL, entry+1);
return mask;
Expand Down
13 changes: 13 additions & 0 deletions t/t4300-merge-tree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,19 @@ EXPECTED
test_cmp expected actual
'

test_expect_success 'file remove A, B (same)' '
cat >expected <<\EXPECTED &&
EXPECTED
git reset --hard initial &&
test_commit "rm-a-b-base" "ONE" "AAA" &&
git rm ONE &&
git commit -m "rm-a-b" &&
git tag "rm-a-b" &&
git merge-tree rm-a-b-base rm-a-b rm-a-b >actual &&
test_cmp expected actual
'

test_expect_success 'file change A, remove B' '
cat >expected <<\EXPECTED &&
removed in remote
Expand Down

0 comments on commit 27f0d3b

Please sign in to comment.