Merge branch 'jn/plug-empty-tree-leak'
authorJunio C Hamano <gitster@pobox.com>
Thu, 25 Aug 2011 23:00:29 +0000 (16:00 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 25 Aug 2011 23:00:29 +0000 (16:00 -0700)
* jn/plug-empty-tree-leak:
merge-recursive: take advantage of hardcoded empty tree
revert: plug memory leak in "cherry-pick root commit" codepath

1  2 
builtin/revert.c
merge-recursive.c
t/t3503-cherry-pick-root.sh
Simple merge
Simple merge
index 9aefe3a1becac200f2c29beee84fab278f9fcfa0,472e5b80d7ac9b5c90810bd0869510e1e2970f81..e27f39d1e5b0fb0ac3a1fc6417f0f3240934f07d
@@@ -22,31 -29,9 +29,32 @@@ test_expect_success setup 
  
  test_expect_success 'cherry-pick a root commit' '
  
+       git checkout second^0 &&
        git cherry-pick master &&
 -      test first = $(cat file1)
 +      echo first >expect &&
 +      test_cmp expect file1
 +
 +'
 +
 +test_expect_success 'revert a root commit' '
 +
 +      git revert master &&
 +      test_path_is_missing file1
 +
 +'
 +
 +test_expect_success 'cherry-pick a root commit with an external strategy' '
 +
 +      git cherry-pick --strategy=resolve master &&
 +      echo first >expect &&
 +      test_cmp expect file1
 +
 +'
 +
 +test_expect_success 'revert a root commit with an external strategy' '
 +
 +      git revert --strategy=resolve master &&
 +      test_path_is_missing file1
  
  '