Re: [PATCH v4 3/4] git-cherry-pick: Add test to validate new options
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:33
Neil Horman [off-list ref] writes:
Since we've added the --allow-empty and --keep-redundant-commits options to git cherry-pick we should also add a test to ensure that its working properly
Missing full-stop at the end of the sentence
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
+test_expect_success 'cherry pick an empty non-ff commit without --allow-empty' '
+ git checkout master &&
+ echo fourth >> file2 &&
+ git add file2 &&
+ git commit -m "fourth" && {
+ git cherry-pick empty-branch2
+ test "$?" = 1
+ }
+'Do we _deeply_ care that it fails with status 1, or should this be test_must_fail?
+test_expect_success 'cherry pick an empty non-ff commit with --allow-empty' '
+ git checkout master && {
+ git cherry-pick --allow-empty empty-branch2
+ test "$?" = 0
+ }
+'Lose the 'test "$?" = 0' here.
+test_expect_success 'cherry pick with --keep-redundant-commits' '
+ git checkout master && {
+ git cherry-pick --keep-redundant-commits HEAD^
+ test "$?" = 0Likewise.
+ } +' + test_done
Thanks.