aboutsummaryrefslogtreecommitdiff
path: root/t/t4150-am.sh
Commit message (Collapse)AuthorAge
* tests: add missing &&Jonathan Nieder2010-11-09
| | | | | | | | | | | 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>
* Teach "apply --index-info" to handle rename patchesJunio C Hamano2010-07-23
| | | | | | | | | | | | | | | | | | | | | | With v1.5.3.2~14 (apply --index-info: fall back to current index for mode changes, 2007-09-17), git apply learned to stop worrying about the lack of diff index line when a file already present in the current index had no content change. But it still worries too much: for rename patches, it is checking that both the old and new filename are present in the current index. This makes no sense, since a file rename generally involves creating a file there was none before. So just check the old filename. Noticed while trying to use “git rebase” with diff.renames = copies. [jn: add tests] Reported-by: David D. Kilzer <ddkilzer@kilzer.net> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t4150 (am): futureproof against failing testsJonathan Nieder2010-07-23
| | | | | | | | | | | | | | | | | | | | Most tests in t4150 begin by navigating to a sane state and applying some patch: git checkout first && git am patch1 If a previous test left behind unmerged files or a .git/rebase-apply directory, they are untouched and the test fails, causing later tests to fail, too. This is not a problem in practice because none of the tests leave a mess behind. But as a futureproofing measure, it is still best to avoid the problem and clean up at the start of each test. In particular, this simplifies the process of adding new tests that are known to fail. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t4150 (am): style fixJonathan Nieder2010-07-23
| | | | | | | | | | | | | | | | | | | | | Place setup commands in test_expect_success blocks. This makes the rare event of the setup commands breaking on some platform easier to diagnose, and more importantly, it visually distinguishes where each test begins and ends. Instead of running test -z against the result of "git diff" command substitution, use "git diff --exit-code", to improve output when running with the "-v" option. Use test_cmp in place of "test $(foo) = $(bar)" for similar reasons. Remove whitespace after the > and < redirection operators for consistency with other tests. The order of arguments to test_cmp is "test_cmp expected actual". Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* fix portability issues with $ in double quotesStephen Boyd2010-01-26
| | | | | | | | Using a dollar sign in double quotes isn't portable. Escape them with a backslash or replace the double quotes with single quotes. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* am: fix patch format detection for Thunderbird "Save As" emailsStephen Boyd2010-01-25
| | | | | | | | | | | | The patch detection wants to inspect all the headers of a rfc2822 message and ensure that they look like header fields. The headers are always separated from the message body with a blank line. When Thunderbird saves the message the blank line separating the headers from the body includes a CR. The patch detection is failing because a CRLF doesn't match /^$/. Fix this by allowing a CR to exist on the separating line. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* am: allow individual e-mail files as inputJunio C Hamano2009-08-06
| | | | | | | | | | | | | | | | | | | | | | | | We traditionally allowed a mbox file or a directory name of a maildir (but never an individual file inside a maildir) to be given to "git am". Even though an individual file in a maildir (or more generally, a piece of RFC2822 e-mail) is not a mbox file, it contains enough information to create a commit out of it, so there is no reason to reject one. Running mailsplit on such a file feels stupid, but it does not hurt. This builds on top of a5a6755 (git-am foreign patch support: introduce patch_format, 2009-05-27) that introduced mailbox format detection. The codepath to deal with a mbox requires it to begin with "From " line and also allows it to begin with "From: ", but a random piece of e-mail can and often do begin with any valid RFC2822 header lines. Instead of checking the first line, we extract all the lines up to the first empty line, and make sure they look like e-mail headers. A test is added to t4150 to demonstrate this feature. Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* am, rebase: teach quiet optionStephen Boyd2009-06-18
| | | | | | | | | | | | | | | git-am and git-rebase are talkative scripts. Teach them to be quiet when told, allowing them to speak only when they fail or experience errors. The quiet option is maintained when git-am or git-rebase fails to apply a patch. This means subsequent --resolved, --continue, --skip, --abort invocations will be quiet if the original invocation was quiet. Drop a handful of >&2 redirection; the rest of the program sends all the info messages to stdout, not to stderr. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t4150: test applying with a newline in subjectStephen Boyd2009-06-18
| | | | | | | | | | | Commit 4b7cc26 (git-am: use printf instead of echo on user-supplied strings, 2007-05-25) fixed a bug where subjects with newlines would cause git-am to echo multiple lines when it says "Applying: <subject>". This test ensures that fix stays valid. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-am: teach git-am to apply a patch to an unborn branchNanako Shiraishi2009-04-12
| | | | | | | | People sometimes wonder why they cannot apply a patch that only creates new files to an unborn branch. Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-am: Add --ignore-date optionNanako Shiraishi2009-01-25
| | | | | | | | | | | | | | | | | This new option tells 'git-am' to ignore the date header field recorded in the format-patch output. The commits will have the timestamp when they are created instead. You can work a lot in one day to accumulate many changes, but apply and push to the public repository only some of them at the end of the first day. Then next day you can spend all your working hours reading comics or chatting with your coworkers, and apply your remaining patches from the previous day using this option to pretend that you have been working at the end of the day. Signed-off-by: しらいしななこ <nanako3@lavabit.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* am: Add --committer-date-is-author-date optionJunio C Hamano2009-01-25
| | | | | | | | This new option tells 'git-am' to use the timestamp recorded in the Email message as both author and committer date. Signed-off-by: しらいしななこ <nanako3@lavabit.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* tests: grep portability fixesJeff King2008-09-30
| | | | | | | | | | | | | | | | | | | | We try to avoid using the "-q" or "-e" options, as they are largely useless, as explained in aadbe44f. There is one exception for "-e" here, which is in t7701 used to produce an "or" of patterns. This can be rewritten as an egrep pattern. This patch also removes use of "grep -F" in favor of the more widely available "fgrep". [sp: Tested on AIX 5.3 by Mike Ralphson, Tested on MinGW by Johannes Sixt] Signed-off-by: Jeff King <peff@peff.net> Tested-by: Mike Ralphson <mike@abacus.co.uk> Tested-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* tests: use "git xyzzy" form (t3600 - t6999)Nanako Shiraishi2008-09-03
| | | | | | | Converts tests between t3600-t6300. Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Rename .git/rebase to .git/rebase-applyJohannes Schindelin2008-07-21
| | | | | | | | | | With git-am, it sounds awkward to have the patches in ".git/rebase/", but for technical reasons, we have to keep the same directory name for git-am and git-rebase. ".git/rebase-apply" seems to be a good compromise. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'sb/dashless'Junio C Hamano2008-07-16
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sb/dashless: Make usage strings dash-less t/: Use "test_must_fail git" instead of "! git" t/test-lib.sh: exit with small negagive int is ok with test_must_fail Conflicts: builtin-blame.c builtin-mailinfo.c builtin-mailsplit.c builtin-shortlog.c git-am.sh t/t4150-am.sh t/t4200-rerere.sh
| * t/: Use "test_must_fail git" instead of "! git"Stephan Beyer2008-07-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes every occurrence of "! git" -- with the meaning that a git call has to gracefully fail -- into "test_must_fail git". This is useful to - make sure the test does not fail because of a signal, e.g. SIGSEGV, and - advertise the use of "test_must_fail" for new tests. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"Johannes Schindelin2008-07-15
|/ | | | | | | | | | | Since the files generated and used during a rebase are never to be tracked, they should live in $GIT_DIR. While at it, avoid the rather meaningless term "dotest" to "rebase", and unhide ".dotest-merge". This was wished for on the mailing list, but so far unimplemented. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* fix whitespace violations in test scriptsJeff King2008-06-14
| | | | | | | | | 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>
* Merge t4150-am-subdir.sh and t4151-am.sh into t4150-am.shStephan Beyer2008-05-31
This patch moves the am test cases in t4150-am.sh and the am subdirectory test cases from t/t4150-am-subdir.sh into t/4151-am.sh. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>