From: Junio C Hamano Date: Wed, 4 May 2011 21:58:42 +0000 (-0700) Subject: Merge branch 'jk/maint-stash-oob' into maint X-Git-Tag: v1.7.5.1~3 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=be44a20aa88b196b769dd894c0ac7a9ff5a7a1f6;p=git.git Merge branch 'jk/maint-stash-oob' into maint * jk/maint-stash-oob: stash: fix false positive in the invalid ref test. stash: fix accidental apply of non-existent stashes Conflicts: t/t3903-stash.sh --- be44a20aa88b196b769dd894c0ac7a9ff5a7a1f6 diff --cc t/t3903-stash.sh index 0bd667f04,3c91f48b2..5c7254064 --- a/t/t3903-stash.sh +++ b/t/t3903-stash.sh @@@ -37,21 -37,17 +37,27 @@@ test_expect_success 'parents of stash' test_cmp output expect ' + test_expect_success 'applying bogus stash does nothing' ' + test_must_fail git stash apply stash@{1} && + echo 1 >expect && + test_cmp expect file + ' + -test_expect_success 'apply needs clean working directory' ' - echo 4 > other-file && +test_expect_success 'apply does not need clean working directory' ' + echo 4 >other-file && git add other-file && - echo 5 > other-file && - test_must_fail git stash apply + echo 5 >other-file && + git stash apply && + echo 3 >expect && + test_cmp expect file +' + +test_expect_success 'apply does not clobber working directory changes' ' + git reset --hard && + echo 4 >file && + test_must_fail git stash apply && + echo 4 >expect && + test_cmp expect file ' test_expect_success 'apply stashed changes' '