From: Jeff King <peff@peff.net>
To: git@vger.kernel.org
Subject: [PATCH 1/2] t7501: fix "empty commit" test with NO_PERL
Date: Thu, 23 Jan 2014 14:54:57 -0500 [thread overview]
Message-ID: <20140123195456.GA31871@sigill.intra.peff.net> (raw)
In-Reply-To: <20140123195404.GA31314@sigill.intra.peff.net>
t7501.9 tries to check that "git commit" will fail when the
index is unchanged. It relies on previous tests not to have
modified the index. When it was originally written, this was
always the case. However, commit c65dc35 (t7501: test the
right kind of breakage, 2012-03-30) changed earlier tests (4
and 5) to leave a modification in the index.
We never noticed, however, because t7501.7, between the two,
clears the index state as a side effect. However, that test
depends on the PERL prerequisite, and so it does not always
run. Therefore if NO_PERL is set, we do not run the
intervening test, the index is left unclean, and t7501.9
fails.
We could fix this by moving t7501.9 up in the script.
However, this patch instead leaves it in place and adds a
"git reset" before the commit. This makes the test more
explicit about its preconditions, and will future-proof it
against any other changes in the test state.
Signed-off-by: Jeff King <peff@peff.net>
---
t/t7501-commit.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index f04798f..94eec83 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -57,6 +57,7 @@ test_expect_success 'using invalid commit with -C' '
'
test_expect_success 'nothing to commit' '
+ git reset --hard &&
test_must_fail git commit -m initial
'
--
1.8.5.2.500.g8060133
next prev parent reply other threads:[~2014-01-23 19:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-23 19:54 [PATCH 0/2] solaris test fixups Jeff King
2014-01-23 19:54 ` Jeff King [this message]
2014-01-23 19:55 ` [PATCH 2/2] t7700: do not use "touch -r" Jeff King
2014-01-23 21:12 ` Junio C Hamano
2014-01-23 21:14 ` Jeff King
2014-01-23 21:24 ` Junio C Hamano
2014-01-23 21:28 ` Jeff King
2014-01-23 20:52 ` [PATCH 0/2] solaris test fixups Junio C Hamano
2014-01-23 20:54 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140123195456.GA31871@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).