]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t3200-branch.sh
refs_resolve_ref_unsafe: handle d/f conflicts for writes
[thirdparty/git.git] / t / t3200-branch.sh
index 3ac7ebf85f3198cde56f784456e0024205aec853..503a88d0296a2620ed0ba6e70f784fcd58dc4a9b 100755 (executable)
@@ -117,6 +117,16 @@ test_expect_success 'git branch -m bbb should rename checked out branch' '
        test_cmp expect actual
 '
 
+test_expect_success 'renaming checked out branch works with d/f conflict' '
+       test_when_finished "git branch -D foo/bar || git branch -D foo" &&
+       test_when_finished git checkout master &&
+       git checkout -b foo &&
+       git branch -m foo/bar &&
+       git symbolic-ref HEAD >actual &&
+       echo refs/heads/foo/bar >expect &&
+       test_cmp expect actual
+'
+
 test_expect_success 'git branch -m o/o o should fail when o/p exists' '
        git branch o/o &&
        git branch o/p &&