From: "Shawn O. Pearce" <spearce@spearce.org>
To: Nicolas Pitre <nico@cam.org>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] pack-objects: Allow missing base objects when creating thin packs
Date: Tue, 12 Aug 2008 11:18:43 -0700 [thread overview]
Message-ID: <20080812181843.GD31092@spearce.org> (raw)
In-Reply-To: <alpine.LFD.1.10.0808121402440.22892@xanadu.home>
Nicolas Pitre <nico@cam.org> wrote:
> On Tue, 12 Aug 2008, Shawn O. Pearce wrote:
> > +# Clone patch_clone indirectly by cloning base and fetching.
> > +#
> > +test_expect_success \
> > + 'indirectly clone patch_clone' \
> > + '(mkdir user_clone &&
> > + cd user_clone &&
> > + git init &&
> > + git pull ../.git &&
> > + test $(git rev-parse HEAD) = $B
> > +
> > + git pull ../patch_clone/.git &&
> > + test $(git rev-parse HEAD) = $C
> > + )
> > + '
>
> What if the first test command fails? Won't its result be ignored?
Isn't the exit status of the subshell the exit status of the last
command in the subshell?
I just changed the test line to compare to "x$C" instead of $C
and it correctly detected the error condition:
$ git diff
diff --git a/t/t5306-pack-nobase.sh b/t/t5306-pack-nobase.sh
index 503e9d4..7c55e9e 100755
--- a/t/t5306-pack-nobase.sh
+++ b/t/t5306-pack-nobase.sh
@@ -62,7 +62,7 @@ test_expect_success \
test $(git rev-parse HEAD) = $B
git pull ../patch_clone/.git &&
- test $(git rev-parse HEAD) = $C
+ test $(git rev-parse HEAD) = x$C
)
'
$ ./t5306-pack-nobase.sh
* ok 1: setup base
* ok 2: setup patch_clone
* FAIL 3: indirectly clone patch_clone
(mkdir user_clone &&
cd user_clone &&
git init &&
git pull ../.git &&
test $(git rev-parse HEAD) = $B
git pull ../patch_clone/.git &&
test $(git rev-parse HEAD) = x$C
)
* ok 4: clone of patch_clone is incomplete
* failed 1 among 4 test(s)
--
Shawn.
next prev parent reply other threads:[~2008-08-12 18:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-11 18:28 RFC: Allow missing objects during packing Shawn O. Pearce
2008-08-11 22:39 ` Junio C Hamano
2008-08-11 22:44 ` Shawn O. Pearce
2008-08-12 1:28 ` Shawn O. Pearce
2008-08-12 2:08 ` Junio C Hamano
2008-08-12 4:44 ` Nicolas Pitre
2008-08-12 16:41 ` [PATCH] pack-objects: Allow missing base objects when creating thin packs Shawn O. Pearce
2008-08-12 18:12 ` Nicolas Pitre
2008-08-12 18:18 ` Shawn O. Pearce [this message]
2008-08-12 18:26 ` Nicolas Pitre
2008-08-12 18:31 ` [PATCH v2] " Shawn O. Pearce
2008-08-12 18:43 ` Nicolas Pitre
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=20080812181843.GD31092@spearce.org \
--to=spearce@spearce.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=nico@cam.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).