]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t2018-checkout-branch.sh
Prevent force-updating of the current branch
[thirdparty/git.git] / t / t2018-checkout-branch.sh
index a42e03967b1df3001df24089f2c50008c092ac51..b66db2b8818b7b084889ea1b2c7687fc59c12127 100755 (executable)
@@ -180,4 +180,12 @@ test_expect_success 'checkout -b <describe>' '
        test_cmp expect actual
 '
 
+test_expect_success 'checkout -B to the current branch fails before merging' '
+       git checkout branch1 &&
+       setup_dirty_mergeable &&
+       git commit -mfooble &&
+       test_must_fail git checkout -B branch1 initial &&
+       test_must_fail test_dirty_mergeable
+'
+
 test_done