author | Junio C Hamano <gitster@pobox.com> | |
Thu, 25 Aug 2011 23:00:29 +0000 (16:00 -0700) | ||
committer | Junio 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
merge-recursive: take advantage of hardcoded empty tree
revert: plug memory leak in "cherry-pick root commit" codepath
1 | 2 | |||
---|---|---|---|---|
builtin/revert.c | patch | | diff1 | | diff2 | | blob | history |
merge-recursive.c | patch | | diff1 | | diff2 | | blob | history |
t/t3503-cherry-pick-root.sh | patch | | diff1 | | diff2 | | blob | history |
diff --cc builtin/revert.c
Simple merge
diff --cc merge-recursive.c
Simple merge
diff --cc t/t3503-cherry-pick-root.sh
index 9aefe3a1becac200f2c29beee84fab278f9fcfa0,472e5b80d7ac9b5c90810bd0869510e1e2970f81..e27f39d1e5b0fb0ac3a1fc6417f0f3240934f07d
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
'