X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft3404-rebase-interactive.sh;h=62e65d704b37eb92509a8ad7e844cea8a675ed50;hb=860cc3a4f9c3ac21fcd37bbe30f40ab073f01299;hp=e33ea4e9f4c33cc1f94cd184c371a8fa05bedf3b;hpb=752527f51396886c4ca11a14bfcecf2167ed4c40;p=git.git diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index e33ea4e9f..62e65d704 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -61,8 +61,8 @@ test_expect_success 'setup' ' git tag I ' -cat > fake-editor.sh <<\EOF -#!/bin/sh +echo "#!$SHELL" >fake-editor +cat >> fake-editor.sh <<\EOF case "$1" in */COMMIT_EDITMSG) test -z "$FAKE_COMMIT_MESSAGE" || echo "$FAKE_COMMIT_MESSAGE" > "$1" @@ -340,4 +340,26 @@ test_expect_success 'rebase a commit violating pre-commit' ' ' +test_expect_success 'rebase with a file named HEAD in worktree' ' + + rm -fr .git/hooks && + git reset --hard && + git checkout -b branch3 A && + + ( + GIT_AUTHOR_NAME="Squashed Away" && + export GIT_AUTHOR_NAME && + >HEAD && + git add HEAD && + git commit -m "Add head" && + >BODY && + git add BODY && + git commit -m "Add body" + ) && + + FAKE_LINES="1 squash 2" git rebase -i to-be-rebased && + test "$(git show -s --pretty=format:%an)" = "Squashed Away" + +' + test_done