Merge branch 'ds/cvsexportcommit-force-text'
[gitweb.git] / t / t3511-cherry-pick-x.sh
index 9888bf34b9538f6e4aae1a1c65022ae126a62ce2..84a587daf3af0356244c58c6472e202875679200 100755 (executable)
@@ -298,4 +298,24 @@ test_expect_success 'cherry-pick preserves commit message' '
        test_cmp expect actual
 '
 
+test_expect_success 'cherry-pick -x cleans commit message' '
+       pristine_detach initial &&
+       git cherry-pick -x mesg-unclean &&
+       git log -1 --pretty=format:%B >actual &&
+       printf "%s\n(cherry picked from commit %s)\n" \
+               "$mesg_unclean" $(git rev-parse mesg-unclean) |
+                       git stripspace >expect &&
+       test_cmp expect actual
+'
+
+test_expect_success 'cherry-pick -x respects commit.cleanup' '
+       pristine_detach initial &&
+       git -c commit.cleanup=strip cherry-pick -x mesg-unclean &&
+       git log -1 --pretty=format:%B >actual &&
+       printf "%s\n(cherry picked from commit %s)\n" \
+               "$mesg_unclean" $(git rev-parse mesg-unclean) |
+                       git stripspace -s >expect &&
+       test_cmp expect actual
+'
+
 test_done