]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t3501-revert-cherry-pick.sh
Merge branch 'ma/win32-unix-domain-socket'
[thirdparty/git.git] / t / t3501-revert-cherry-pick.sh
index aeab689a98d00919e0473380fc9bf40497b32c80..411027fb58c7dfb657409980970e71005f2c79c5 100755 (executable)
@@ -104,11 +104,19 @@ test_expect_success 'revert forbidden on dirty working tree' '
 '
 
 test_expect_success 'cherry-pick on unborn branch' '
-       git checkout --orphan unborn &&
+       git switch --orphan unborn &&
        git rm --cached -r . &&
-       rm -rf * &&
        git cherry-pick initial &&
-       git diff --quiet initial &&
+       git diff --exit-code initial &&
+       test_cmp_rev ! initial HEAD
+'
+
+test_expect_success 'cherry-pick on unborn branch with --allow-empty' '
+       git checkout --detach &&
+       git branch -D unborn &&
+       git switch --orphan unborn &&
+       git cherry-pick initial --allow-empty &&
+       git diff --exit-code initial &&
        test_cmp_rev ! initial HEAD
 '
 
@@ -170,6 +178,7 @@ test_expect_success 'advice from failed revert' '
        hint: You can instead skip this commit with "git revert --skip".
        hint: To abort and get back to the state before "git revert",
        hint: run "git revert --abort".
+       hint: Disable this message with "git config advice.mergeConflict false"
        EOF
        test_commit --append --no-tag "double-add dream" dream dream &&
        test_must_fail git revert HEAD^ 2>actual &&