Skip to content

Commit 07c6066

Browse files
committed
Merge branch 'kh/mv-breakage'
Demonstrate an assertion failure in 'git mv'. * kh/mv-breakage: t7001: add failure test which triggers assertion
2 parents 787297b + 0fcd473 commit 07c6066

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

t/t7001-mv.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,4 +551,16 @@ test_expect_success 'moving nested submodules' '
551551
git status
552552
'
553553

554+
test_expect_failure 'nonsense mv triggers assertion failure and partially updated index' '
555+
test_when_finished git reset --hard HEAD &&
556+
git reset --hard HEAD &&
557+
mkdir -p a &&
558+
mkdir -p b &&
559+
>a/a.txt &&
560+
git add a/a.txt &&
561+
test_must_fail git mv a/a.txt a b &&
562+
git status --porcelain >actual &&
563+
grep "^A[ ]*a/a.txt$" actual
564+
'
565+
554566
test_done

0 commit comments

Comments
 (0)