From: Jon Seymour <jon.seymour@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, chriscool@tuxfamily.org, j6t@kdbg.org,
jnareb@gmail.com, jrnieder@gmail.com,
Jon Seymour <jon.seymour@gmail.com>
Subject: [PATCH 2/3] bisect: add tests for bisection on bare repositories
Date: Sun, 7 Aug 2011 20:50:39 +1000 [thread overview]
Message-ID: <1312714240-23647-3-git-send-email-jon.seymour@gmail.com> (raw)
In-Reply-To: <1312714240-23647-1-git-send-email-jon.seymour@gmail.com>
We add a test to check that bisection works on bare repositories
both when --no-checkout is specified explicitly and when it
is defaulted.
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
---
t/t6030-bisect-porcelain.sh | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index 4fb7d11..eb0412c 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -592,6 +592,34 @@ test_expect_success 'erroring out when using bad path parameters' '
grep "bad path parameters" error.txt
'
+test_expect_success 'create bare repo' '
+ git clone --bare . bare
+'
+
+test_expect_success 'test bisection on bare repo - --no-checkout specified' '
+ test_when_finished "cd .." &&
+ cd bare &&
+ git bisect start --no-checkout &&
+ git bisect good $HASH1 &&
+ git bisect bad $HASH4 &&
+ git bisect run sh -c \
+ "test \$(git rev-list BISECT_HEAD ^$HASH2 --max-count=1 | wc -l) = 0" \
+ >../my_bisect_log.txt &&
+ grep "$HASH3 is the first bad commit" ../my_bisect_log.txt &&
+ git bisect reset'
+
+test_expect_success 'test bisection on bare repo - --no-checkout defaulted' '
+ test_when_finished "cd .." &&
+ cd bare &&
+ git bisect start &&
+ git bisect good $HASH1 &&
+ git bisect bad $HASH4 &&
+ git bisect run sh -c \
+ "test \$(git rev-list BISECT_HEAD ^$HASH2 --max-count=1 | wc -l) = 0" \
+ >../my_bisect_log.txt &&
+ grep "$HASH3 is the first bad commit" ../my_bisect_log.txt &&
+ git bisect reset'
+
#
# This creates a broken branch which cannot be checked out because
# the tree created has been deleted.
--
1.7.6.363.g9b380.dirty
next prev parent reply other threads:[~2011-08-07 10:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-07 10:50 [PATCH 0/3] bisect: add support for bisecting bare repositories Jon Seymour
2011-08-07 10:50 ` [PATCH 1/3] bisect: relax requirement for a working tree Jon Seymour
2011-08-07 12:41 ` test z$foo = zbar (and Re: [PATCH 1/3] bisect: relax requirement for a working tree.) Jonathan Nieder
2011-08-07 12:51 ` Jon Seymour
2011-08-07 13:04 ` Stefano Lattarini
2011-08-07 14:10 ` Jonathan Nieder
2011-08-07 14:40 ` [PATCH 1/3] bisect: relax requirement for a working tree Jon Seymour
2011-08-07 10:50 ` Jon Seymour [this message]
2011-08-07 13:39 ` [PATCH 2/3] bisect: add tests for bisection on bare repositories Jonathan Nieder
2011-08-07 14:39 ` Jon Seymour
2011-08-07 10:50 ` [PATCH 3/3] bisect: document that --no-checkout is the default for " Jon Seymour
2011-08-07 13:43 ` Jonathan Nieder
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=1312714240-23647-3-git-send-email-jon.seymour@gmail.com \
--to=jon.seymour@gmail.com \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j6t@kdbg.org \
--cc=jnareb@gmail.com \
--cc=jrnieder@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.