X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft3903-stash.sh;h=663c60a12e82c96065e60fd448a6583c91e5a2cd;hb=69f4e08f535d4e5a035069a64d1ebaea7be55d83;hp=fcdb18217a777f5dbb77b0071af7159c6985656d;hpb=7f1068e21e5840fca0787f0925e62148b2f873ed;p=git.git diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index fcdb18217..663c60a12 100755 --- a/t/t3903-stash.sh +++ b/t/t3903-stash.sh @@ -444,7 +444,7 @@ test_expect_success 'stash show - stashes on stack, stash-like argument' ' git reset --hard && cat >expected <<-EOF && file | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) + 1 file changed, 1 insertion(+) EOF git stash show ${STASH_ID} >actual && test_cmp expected actual @@ -482,7 +482,7 @@ test_expect_success 'stash show - no stashes on stack, stash-like argument' ' git reset --hard && cat >expected <<-EOF && file | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) + 1 file changed, 1 insertion(+) EOF git stash show ${STASH_ID} >actual && test_cmp expected actual @@ -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