Skip to content

Commit c8ba6b1

Browse files
moygitster
authored andcommitted
Add a testcase for "git mv -f" on untracked files.
This currently fails with: git: builtin-mv.c:217: cmd_mv: Assertion `pos >= 0' failed. Signed-off-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 720ec6b commit c8ba6b1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

t/t7001-mv.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ test_expect_success \
5858
test ! -f path0/untracked1 &&
5959
test ! -f path0/untracked2'
6060

61+
test_expect_failure \
62+
'checking -f on untracked file with existing target' \
63+
'touch path0/untracked1 &&
64+
git mv -f untracked1 path0
65+
test ! -f .git/index.lock &&
66+
test -f untracked1 &&
67+
test -f path0/untracked1'
68+
6169
# clean up the mess in case bad things happen
6270
rm -f idontexist untracked1 untracked2 \
6371
path0/idontexist path0/untracked1 path0/untracked2 \

0 commit comments

Comments
 (0)