Merge branch 'jl/submodule-ignore-diff'
[gitweb.git] / t / t3501-revert-cherry-pick.sh
index e4fbf7a2107c680ee5c51f2ccf5297ed1fd4d868..bc7aedd0484ed5ad1115cac0f22943445d658f47 100755 (executable)
@@ -41,6 +41,24 @@ test_expect_success setup '
        git tag rename2
 '
 
+test_expect_success 'cherry-pick --nonsense' '
+
+       pos=$(git rev-parse HEAD) &&
+       git diff --exit-code HEAD &&
+       test_must_fail git cherry-pick --nonsense 2>msg &&
+       git diff --exit-code HEAD "$pos" &&
+       grep '[Uu]sage:' msg
+'
+
+test_expect_success 'revert --nonsense' '
+
+       pos=$(git rev-parse HEAD) &&
+       git diff --exit-code HEAD &&
+       test_must_fail git revert --nonsense 2>msg &&
+       git diff --exit-code HEAD "$pos" &&
+       grep '[Uu]sage:' msg
+'
+
 test_expect_success 'cherry-pick after renaming branch' '
 
        git checkout rename2 &&