From: Junio C Hamano Date: Wed, 27 Apr 2011 18:36:42 +0000 (-0700) Subject: Merge branch 'jk/maint-stash-oob' X-Git-Tag: v1.7.6-rc0~150 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fcbf164fcbf4110c7e2f96356d6707d56ba44ba4;p=git.git Merge branch 'jk/maint-stash-oob' * 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 --- fcbf164fcbf4110c7e2f96356d6707d56ba44ba4 diff --cc t/t3903-stash.sh index 5fcf52a07,3c91f48b2..a27d77862 --- 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' '