X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft3903-stash.sh;h=dbe2ac179dead1ea825f62b7c26e3ceb6c0d638d;hb=0e1cfc52de002e2d9b0e6562e8672fee3bf45a67;hp=fcdb18217a777f5dbb77b0071af7159c6985656d;hpb=c07aa5b218b9f519c29b5be71fe43cd79365dd37;p=git.git diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index fcdb18217..dbe2ac179 100755 --- a/t/t3903-stash.sh +++ b/t/t3903-stash.sh @@ -601,4 +601,28 @@ test_expect_success 'stash apply shows status same as git status (relative to cu test_cmp expect actual ' +cat > expect << EOF +diff --git a/HEAD b/HEAD +new file mode 100644 +index 0000000..fe0cbee +--- /dev/null ++++ b/HEAD +@@ -0,0 +1 @@ ++file-not-a-ref +EOF + +test_expect_success 'stash where working directory contains "HEAD" file' ' + git stash clear && + git reset --hard && + echo file-not-a-ref > HEAD && + git add HEAD && + test_tick && + git stash && + git diff-files --quiet && + git diff-index --cached --quiet HEAD && + test "$(git rev-parse stash^)" = "$(git rev-parse HEAD)" && + git diff stash^..stash > output && + test_cmp output expect +' + test_done