From 55dcc17c331f580b3beeb4d5decf64d3baf94f2e Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 24 Jun 2010 16:02:28 +0200 Subject: aggressive_tree_merge: fixed incorrect handling of one branch, it was just not implemented causing incorrect merge results. Added test to cover this issue Diff: added NULL_BIN_SHA constant for completeness --- test/git/test_fun.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'test/git/test_fun.py') diff --git a/test/git/test_fun.py b/test/git/test_fun.py index b2b94415..dad9fcda 100644 --- a/test/git/test_fun.py +++ b/test/git/test_fun.py @@ -114,6 +114,36 @@ class TestFun(TestBase): trees = [tb, th, tm] assert_entries(aggressive_tree_merge(odb, trees), 2) + # same file added in both, differently + fa = mkfile('1', shab) + th = mktree(odb, [fa]) + fb = mkfile('1', shac) + tm = mktree(odb, [fb]) + + # expect conflict + trees = [tb, th, tm] + assert_entries(aggressive_tree_merge(odb, trees), 2, True) + + # same file added, different mode + fa = mkfile('1', shab) + th = mktree(odb, [fa]) + fb = mkcommit('1', shab) + tm = mktree(odb, [fb]) + + # expect conflict + trees = [tb, th, tm] + assert_entries(aggressive_tree_merge(odb, trees), 2, True) + + # same file added in both + fa = mkfile('1', shab) + th = mktree(odb, [fa]) + fb = mkfile('1', shab) + tm = mktree(odb, [fb]) + + # expect conflict + trees = [tb, th, tm] + assert_entries(aggressive_tree_merge(odb, trees), 1) + # modify same base file, differently fa = mkfile(bfn, shab) th = mktree(odb, [fa]) -- cgit v1.2.1