summaryrefslogtreecommitdiff
path: root/t/t3903-stash.sh
Commit message (Collapse)AuthorAgeFilesLines
* Revert "git stash: avoid data loss when "git stash save" kills a directory"Junio C Hamano2013-08-141-18/+0
| | | | | | | | | | This reverts commit a73653130edd6a8977106d45a8092c09040f9132, as it has been reported that "ls-files --killed" is too time-consuming in a deep directory with too many untracked crufts (e.g. $HOME/.git tracking only a few files). We'd need to revisit it later but "ls-files --killed" needs to be optimized before it happens.
* git stash: avoid data loss when "git stash save" kills a directoryPetr Baudis2013-07-011-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | "stash save" is about saving the local change to the working tree, but also about restoring the state of the last commit to the working tree. When a local change is to turn a non-directory to a directory, in order to restore the non-directory, everything in the directory needs to be removed. Which is fine when running "git stash save --include-untracked", but without that option, untracked, newly created files in the directory will have to be discarded, if the state you are restoring to has a non-directory at the same path as the directory. Introduce a safety valve to fail the operation in such case, using the "ls-files --killed" which was designed for this exact purpose. The "stash save" is stopped when untracked files need to be discarded because their leading path ceased to be a directory, and the user is required to pass --force to really have the data removed. Signed-off-by: Petr Baudis <pasky@ucw.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'rr/rebase-stash-store'Junio C Hamano2013-06-271-0/+19
|\ | | | | | | | | | | | | | | | | | | | | | | Finishing touches for the "git rebase --autostash" feature introduced earlier. * rr/rebase-stash-store: rebase: use 'git stash store' to simplify logic stash: introduce 'git stash store' stash: simplify option parser for create stash doc: document short form -p in synopsis stash doc: add a warning about using create
| * stash: introduce 'git stash store'Ramkumar Ramachandra2013-06-171-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | save_stash() contains the logic for doing two potentially independent operations; the first is preparing the stash merge commit, and the second is updating the stash ref/ reflog accordingly. While the first operation is abstracted out into a create_stash() for callers to access via 'git stash create', the second one is not. Fix this by factoring out the logic for storing the stash into a store_stash() that callers can access via 'git stash store'. Like create, store is not intended for end user interactive use, but for callers in other scripts. We can simplify the logic in the rebase.autostash feature using this new subcommand. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'fc/show-non-empty-errors-in-test'Junio C Hamano2013-06-201-5/+5
|\ \ | | | | | | | | | | | | * fc/show-non-empty-errors-in-test: test: test_must_be_empty helper
| * | test: test_must_be_empty helperJunio C Hamano2013-06-091-5/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are quite a lot places where an output file is expected to be empty, and we fail the test when it is not. The output from running the test script with -i -v can be helped if we showed the unexpected contents at that point. We could of course do >expected.empty && test_cmp expected.empty actual but this is commmon enough to be done with a dedicated helper. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial cases)Johannes Sixt2013-06-071-11/+28
|/ | | | | | | | | | | | | | | | | | | There are many instances where the treatment of symbolic links in the object model and the algorithms are tested, but where it is not necessary to actually have a symbolic link in the worktree. Make adjustments to the tests and remove the SYMLINKS prerequisite when appropriate in trivial cases, where "trivial" means: - merely a replacement of 'ln -s a b && git add b' by test_ln_s_add is needed; - a test for symbolic link on the file system can be split off (and remains protected by SYMLINKS); - existing code is equivalent to test_ln_s_add. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Fix tests under GETTEXT_POISON on git-stashJiang Xin2012-08-271-1/+1
| | | | | | | | | | | | | Use i18n-specific test functions in test scripts for git-stash. This issue was was introduced in v1.7.4.1-119-g355ec: 355ec i18n: git-status basic messages and been broken under GETTEXT_POISON=YesPlease since. Signed-off-by: Jiang Xin <worldhello.net@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* diff --stat: use less columns for change countsZbigniew Jędrzejewski-Szmek2012-04-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Number of columns required for change counts is now computed based on the maximum number of changed lines instead of being fixed. This means that usually a few more columns will be available for the filenames and the graph. The graph width logic is also modified to include enough space for "Bin XXX -> YYY bytes". If changes to binary files are mixed with changes to text files, change counts are padded to take at least three columns. And the other way around, if change counts require more than three columns, then "Bin"s are padded to align with the change count. This way, the +- part starts in the same column as "XXX -> YYY" part for binary files. This makes the graph easier to parse visually thanks to the empty column. This mimics the layout of diff --stat before this change. Tests and the tutorial are updated to reflect the new --stat output. This means either the removal of extra padding and/or the addition of up to three extra characters to truncated filenames. One test is added to check the graph alignment when a binary file change and text file change of more than 999 lines are committed together. Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* test: use --numstat instead of --stat in "git stash show" testsJonathan Nieder2012-03-131-7/+19
| | | | | | | | | | | | | | | git's diff --stat output is intended for human consumption and since v1.7.9.2~13 (2012-02-01) varies by locale. Add a test checking that git stash show defaults to --stat and tweak the rest of the "stash show" tests that showed a diffstat to use numstat. This way, there are fewer tests to tweak if the diffstat format changes again. This also improves test coverage when running tests with git configured not to write its output in the C locale (e.g., via GETTEXT_POISON=Yes). Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* test: use test_i18ncmp when checking --stat outputJonathan Nieder2012-03-131-2/+2
| | | | | | | | | Ever since v1.7.9.2~13 (2012-02-01), git's diffstat-style summary line produced by "git apply --stat", "git diff --stat", and "git commit" varies by locale, producing test failures when GETTEXT_POISON is set. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Use correct grammar in diffstat summary linend/diffstat-gramnumNguyễn Thái Ngọc Duy2012-02-031-2/+2
| | | | | | | | | | | | | | | | | "git diff --stat" and "git apply --stat" now learn to print the line "%d files changed, %d insertions(+), %d deletions(-)" in singular form whenever applicable. "0 insertions" and "0 deletions" are also omitted unless they are both zero. This matches how versions of "diffstat" that are not prehistoric produced their output, and also makes this line translatable. [jc: with help from Thomas Dickey in archaeology of "diffstat"] [jc: squashed Jonathan's updates to illustrations in tutorials and a test] Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* stash: Don't fail if work dir contains file named 'HEAD'jm/stash-diff-disambiguateJonathon Mah2012-01-011-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | When performing a plain "git stash" (without --patch), git-diff would fail with "fatal: ambiguous argument 'HEAD': both revision and filename". The output was piped into git-update-index, masking the failed exit status. The output is now sent to a temporary file (which is cleaned up by existing code), and the exit status is checked. The "HEAD" arg to the git-diff invocation has been disambiguated too, of course. In patch mode, "git stash -p" would fail harmlessly, leaving the working dir untouched. Interactive adding is fine, but the resulting tree was diffed with an ambiguous 'HEAD' argument. Use >foo (no space) when redirecting output. In t3904, checks and operations on each file are in the order they'll appear when interactively staging. In t3905, fix a bug in "stash save --include-untracked -q is quiet": The redirected stdout file was considered untracked, and so was removed from the working directory. Use test path helper functions where appropriate. Signed-off-by: Jonathon Mah <me@JonathonMah.com> Acked-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'tr/maint-t3903-misquoted-command'Junio C Hamano2011-09-021-1/+1
|\ | | | | | | | | * tr/maint-t3903-misquoted-command: t3903: fix misquoted rev-parse invocation
| * t3903: fix misquoted rev-parse invocationThomas Rast2011-08-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | !"git ..." hopefully always succeeds because "git ..." is not the name of any executable. However, that's not what was intended. Unquote it, and while we're at it, also replace ! with test_must_fail since it is a call to git. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Fix typo: existant->existentDmitry Ivankov2011-06-161-1/+1
| | | | | | | | | | | | | | | | | | refs.c had a error message "Trying to write ref with nonexistant object". And no tests relied on the wrong spelling. Also typo was present in some test scripts internals, these tests still pass. Signed-off-by: Dmitry Ivankov <divanorama@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'dm/stash-k-i-p'Junio C Hamano2011-04-271-0/+8
|\ \ | | | | | | | | | | | | | | | * dm/stash-k-i-p: stash: ensure --no-keep-index and --patch can be used in any order stash: add two more tests for --no-keep-index
| * | stash: add two more tests for --no-keep-indexDan McGee2011-04-071-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | One of these passes just fine; the other one exposes a problem where command line flag order matters for --no-keep-index and --patch interaction. Signed-off-by: Dan McGee <dpmcgee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'jk/maint-stash-oob'Junio C Hamano2011-04-271-5/+11
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.Jon Seymour2011-04-051-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Jeff King reported a problem with git stash apply incorrectly applying an invalid stash reference. There is an existing test that should have caught this, but the test itself was broken, resulting in a false positive. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | stash: fix accidental apply of non-existent stashesJeff King2011-04-051-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Once upon a time, "git rev-parse ref@{9999999}" did not generate an error. Therefore when we got an invalid stash reference in "stash apply", we could end up not noticing until quite late. Commit b0f0ecd (detached-stash: work around git rev-parse failure to detect bad log refs, 2010-08-21) handled this by checking for the "Log for stash has only %d entries" warning on stderr when we validated the ref. A few days later, e6eedc3 (rev-parse: exit with non-zero status if ref@{n} is not valid., 2010-08-24) fixed the original issue. That made the extra stderr test superfluous, but also introduced a new bug. Now the early call to: git rev-parse --symbolic "$@" fails, but we don't notice the exit code. Worse, its empty output means we think the user didn't provide us a ref, and we try to apply stash@{0}. This patch checks the rev-parse exit code and fails early in the revision parsing process. We can also get rid of the stderr test; as a bonus, this means that "stash apply" can now run under GIT_TRACE=1 properly. Signed-off-by: Jeff King <peff@peff.net> Acked-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | stash: drop dirty worktree check on applyJeff King2011-04-061-4/+16
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before we apply a stash, we make sure there are no changes in the worktree that are not in the index. This check dates back to the original git-stash.sh, and is presumably intended to prevent changes in the working tree from being accidentally lost during the merge. However, this check has two problems: 1. It is overly restrictive. If my stash changes only file "foo", but "bar" is dirty in the working tree, it will prevent us from applying the stash. 2. It is redundant. We don't touch the working tree at all until we actually call merge-recursive. But it has its own (much more accurate) checks to avoid losing working tree data, and will abort the merge with a nicer message telling us which paths were problems. So we can simply drop the check entirely. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Add test: git stash shows status relative to current dirPiotr Krukowiecki2011-03-201-0/+19
|/ / | | | | | | | | | | | | [jc: moved "cd subdir" inside subshell and fixed comparison with expected] Signed-off-by: Piotr Krukowiecki <piotr.krukowiecki@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | tests: add missing &&Jonathan Nieder2010-11-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | Breaks in a test assertion's && chain can potentially hide failures from earlier commands in the chain. Commands intended to fail should be marked with !, test_must_fail, or test_might_fail. The examples in this patch do not require that. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | stash: fix git stash branch regression when branch creation failsJon Seymour2010-09-291-1/+1
| | | | | | | | | | | | | | | | | | "git stash branch <branch> <stash>" started discarding the stash when the branch creation fails. It should have kept the stash intact when aborting. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | stash drops the stash even if creating the branch fails because it already ↵Tomas Carnecky2010-09-291-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | exists This bug was disovered by someone on IRC when he tried to $ git stash branch <branch> <stash> while <branch> already existed. In that case the stash is dropped even though it isn't applied on any branch, so the stash is effectively lost. Signed-off-by: Tomas Carnecky <tom@dbservice.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-stash: fix flag parsingBrian Gernhardt2010-09-261-4/+4
| | | | | | | | | | | | | | | | | | | | Currently git-stash uses `git rev-parse --no-revs -- "$@"` to set its FLAGS variable. This is the same as `FLAGS="-- $@"`. It should use `git rev-parse --no-revs --flags "$@"`, but that eats any "-q" or "--quiet" argument. So move the check for quiet before rev-parse. Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t/t3903-stash: improve testing of git-stash showBrandon Casey2010-09-261-4/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | Recently, the 'stash show' functionality was broken for the case when a stash-like argument was supplied. Since, commit 9bf09e, 'stash show' when supplied a stash-like argument prints nothing and still exists with a zero status. Unfortunately, the flaw slipped through the test suite cracks since the output of 'stash show' was not verified to be correct. Improve and expand on the existing tests so that this flaws is detected. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | tests: subshell indentation stylefixJonathan Nieder2010-09-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Format the subshells introduced by the previous patch (Several tests: cd inside subshell instead of around, 2010-09-06) like so: ( cd subdir && ... ) && This is generally easier to read and has the nice side-effect that this patch will show what commands are used in the subshell, making it easier to check for lost environment variables and similar behavior changes. Cc: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'jl/maint-fix-test'Junio C Hamano2010-09-061-3/+3
|\ \ | |/ |/| | | | | | | | | | | * jl/maint-fix-test: Several tests: cd inside subshell instead of around Conflicts: t/t9600-cvsimport.sh
| * Several tests: cd inside subshell instead of aroundJens Lehmann2010-09-061-3/+3
| | | | | | | | | | | | | | | | | | | | Fixed all places where it was a straightforward change from cd'ing into a directory and back via "cd .." to a cd inside a subshell. Found these places with "git grep -w "cd \.\.". Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t3903: fix broken test_must_fail callsJon Seymour2010-08-311-18/+18
| | | | | | | | | | | | | | | | | | | | | | Some tests in detached-stash are calling test_must_fail in such a way that the arguments to test_must_fail do, indeed, fail but not in the manner expected by the test. This patch removes the unnecessary and unhelpful double quotes. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | detached-stash: tests of git stash with stash-like argumentsJon Seymour2010-08-211-0/+112
|/ | | | | | | | | | | | | | | | Adds new tests which check that: * git stash branch handles a stash-like argument when there is a stash stack * git stash branch handles a stash-like argument when there is not a stash stack * git stash show handles a stash-like argument when there is a stash stack * git stash show handles a stash-like argument when there is not a stash stack * git stash drop fails early if the specified argument is not a stash reference * git stash pop fails early if the specified argument is not a stash reference * git stash * fails early if the reference supplied is bogus * git stash fails early with stash@{n} where n >= length of stash log Helped-by: Johannes Sixt Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'gv/portable'Junio C Hamano2010-06-211-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gv/portable: test-lib: use DIFF definition from GIT-BUILD-OPTIONS build: propagate $DIFF to scripts Makefile: Tru64 portability fix Makefile: HP-UX 10.20 portability fixes Makefile: HPUX11 portability fixes Makefile: SunOS 5.6 portability fix inline declaration does not work on AIX Allow disabling "inline" Some platforms lack socklen_t type Make NO_{INET_NTOP,INET_PTON} configured independently Makefile: some platforms do not have hstrerror anywhere git-compat-util.h: some platforms with mmap() lack MAP_FAILED definition test_cmp: do not use "diff -u" on platforms that lack one fixup: do not unconditionally disable "diff -u" tests: use "test_cmp", not "diff", when verifying the result Do not use "diff" found on PATH while building and installing enums: omit trailing comma for portability Makefile: -lpthread may still be necessary when libc has only pthread stubs Rewrite dynamic structure initializations to runtime assignment Makefile: pass CPPFLAGS through to fllow customization Conflicts: Makefile wt-status.h
| * tests: use "test_cmp", not "diff", when verifying the resultGary V. Vaughan2010-05-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | In tests, call test_cmp rather than raw diff where possible (i.e. if the output does not go to a pipe), to allow the use of, say, 'cmp' when the default 'diff -u' is not compatible with a vendor diff. When that is not possible, use $DIFF, as set in GIT-BUILD-OPTIONS. Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | stash tests: stash can lose data in a file removed from the indexCharles Bailey2010-04-201-0/+150
|/ | | | | | | | | | | | | | | | | | | | If a file is removed from the index and then modified in the working tree then stash will discard the working tree file with no way to recover the changes. This can might be done in one of a number of ways. git rm file vi file # edit a new version git stash or with git mv git mv file newfile vi file # make a new file with the old name git stash Signed-off-by: Charles Bailey <charles@hashpling.org>
* 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>