author | Junio C Hamano <gitster@pobox.com> | |
Wed, 27 Apr 2011 18:36:42 +0000 (11:36 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 27 Apr 2011 18:36:42 +0000 (11:36 -0700) |
* 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
stash: fix false positive in the invalid ref test.
stash: fix accidental apply of non-existent stashes
Conflicts:
t/t3903-stash.sh
1 | 2 | |||
---|---|---|---|---|
git-stash.sh | patch | | diff1 | | diff2 | | blob | history |
t/t3903-stash.sh | patch | | diff1 | | diff2 | | blob | history |
diff --cc git-stash.sh
Simple merge
diff --cc t/t3903-stash.sh
index 5fcf52a0715138d98aa62a1e75be7005dc4faf3f,3c91f48b204764804fbf6d1cef1133d3fe518b87..a27d778624c1fe8ca39038f5913eb34a822b23a3
--- 1/t/t3903-stash.sh
--- 2/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
test_cmp output expect
'
-test_expect_success 'apply needs clean working directory' '
- echo 4 > other-file &&
+ 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 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' '