summaryrefslogtreecommitdiff
path: root/t/t3903-stash.sh
Commit message (Collapse)AuthorAgeFilesLines
* stash pop: remove 'apply' options during 'drop' invocationThomas Rast2010-02-151-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | The 'git stash pop' option parsing used to remove the first argument in --index mode. At the time this was implemented, this first argument was always --index. However, since the invention of the -q option in fcdd0e9 (stash: teach quiet option, 2009-06-17) you can cause an internal invocation of git stash drop --index by running git stash pop -q --index which then of course fails because drop doesn't know --index. To handle this, instead let 'git stash apply' decide what the future argument to 'drop' should be. Warning: this means that 'git stash apply' must parse all options that 'drop' can take, and deal with them in the same way. This is currently true for its only option -q. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* stash: simplify defaulting to "save" and reject unknown optionsMatthieu Moy2009-09-011-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | With the earlier DWIM patches, certain combination of options defaulted to the "save" command correctly while certain equally valid combination did not. For example, "git stash -k" were Ok but "git stash -q -k" did not work. This makes the logic of defaulting to "save" much simpler. If there are no non-flag arguments, it is clear that there is no command word, and we default to "save" subcommand. This rule prevents "git stash -q apply" from quietly creating a stash with "apply" as the message. This also teaches "git stash save" to reject an unknown option. This is to keep a mistyped "git stash save --quite" from creating a stash with a message "--quite", and this safety is more important with the new logic to default to "save" with any option-looking argument without an explicit comand word. [jc: this is based on Matthieu's 3-patch series, and a follow-up discussion, and he and Peff take all the credit; if I have introduced bugs while reworking, they are mine.] Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Make 'git stash -k' a short form for 'git stash save --keep-index'Johannes Schindelin2009-07-311-0/+8
| | | | | | | | | | To save me from the carpal tunnel syndrome, make 'git stash' accept the short option '-k' instead of '--keep-index', and for even more convenience, let's DWIM when this developer forgot to type the 'save' command. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* stash: teach quiet optionStephen Boyd2009-06-181-0/+23
| | | | | | | | | Teach stash pop, apply, save, and drop to be quiet when told. By using the quiet option (-q), these actions will be silent unless errors are encountered. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* tests: use "git xyzzy" form (t0000 - t3599)Nanako Shiraishi2008-09-031-1/+1
| | | | | | | Converts tests between t0050-t3903. Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Add a test for "git stash branch"Abhijit Menon-Sen2008-07-061-0/+60
| | | | | | | | Make sure that applying the stash to a new branch after a conflicting change doesn't result in an error when you try to commit. Signed-off-by: Abhijit Menon-Sen <ams@toroid.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* fix whitespace violations in test scriptsJeff King2008-06-141-1/+1
| | | | | | | | | These violations are simply wrong, but were never caught because whitespace policy checking is turned off in the test scripts. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* add test_cmp function for test scriptsJeff King2008-03-131-1/+1
| | | | | | | | | | | | | | | | | | | Many scripts compare actual and expected output using "diff -u". This is nicer than "cmp" because the output shows how the two differ. However, not all versions of diff understand -u, leading to unnecessary test failure. This adds a test_cmp function to the test scripts and switches all "diff -u" invocations to use it. The function uses the contents of "$GIT_TEST_CMP" to compare its arguments; the default is "diff -u". On systems with a less-capable diff, you can do: GIT_TEST_CMP=cmp make test Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t3903-stash.sh: Add tests for new stash commands drop and popBrandon Casey2008-03-031-1/+45
| | | | | Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t3903-stash.sh: Add missing '&&' to body of testcaseBrandon Casey2008-03-031-2/+2
| | | | | Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Make sure git-stash works from subdirectory.Junio C Hamano2007-07-251-0/+7
| | | | | | | | | We say "SUBDIRECTORY_OK" but we did not chdir to toplevel; this is fine as long as everything we use can be started from a subdirectory, but unfortunately "merge-recursive" is not one of the programs you can safely use from a subdirectory. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Teach git-stash to "apply --index"Johannes Schindelin2007-07-061-0/+69
When given this subcommand, git-stash will try to merge the stashed index into the current one. Only trivial merges are possible, since we have no index for the index ;-) If a trivial merge is not possible, git-stash will bail out with a hint to skip the --index option. For good measure, finally include a test case. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>