diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-09-09 23:54:00 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-09-09 23:54:00 +0400 |
commit | 753aaf3aabe698bbc965fdbb66aceb2e5eda2454 (patch) | |
tree | b4895045aa743e1e57d79557c978ee3fa48a227c /t | |
parent | 1bada2b0ccd19ca40c18f01cb4d66675d32d385c (diff) | |
parent | 288c67caf64af111aeb7c45cb8b6ba586a61c724 (diff) |
Merge branch 'jk/stash-list-p'
Teach "git stash list -p" to show the difference between the base
commit version and the working tree version, which is in line with
what "git show" gives.
* jk/stash-list-p:
stash: default listing to working-tree diff
Diffstat (limited to 't')
-rwxr-xr-x | t/t3903-stash.sh | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index 5b79b216e2..1e29962fad 100755 --- a/t/t3903-stash.sh +++ b/t/t3903-stash.sh @@ -685,4 +685,46 @@ test_expect_success 'handle stash specification with spaces' ' grep pig file ' +test_expect_success 'setup stash with index and worktree changes' ' + git stash clear && + git reset --hard && + echo index >file && + git add file && + echo working >file && + git stash +' + +test_expect_success 'stash list implies --first-parent -m' ' + cat >expect <<-\EOF && + stash@{0}: WIP on master: b27a2bc subdir + + diff --git a/file b/file + index 257cc56..d26b33d 100644 + --- a/file + +++ b/file + @@ -1 +1 @@ + -foo + +working + EOF + git stash list -p >actual && + test_cmp expect actual +' + +test_expect_success 'stash list --cc shows combined diff' ' + cat >expect <<-\EOF && + stash@{0}: WIP on master: b27a2bc subdir + + diff --cc file + index 257cc56,9015a7a..d26b33d + --- a/file + +++ b/file + @@@ -1,1 -1,1 +1,1 @@@ + - foo + -index + ++working + EOF + git stash list -p --cc >actual && + test_cmp expect actual +' + test_done |