git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Mikael Magnusson" <mikachu@gmail.com>
Cc: "Git Mailing List" <git@vger.kernel.org>
Subject: Re: Weird problem with long $PATH and alternates (bisected)
Date: Sun, 26 Oct 2008 09:15:18 -0700	[thread overview]
Message-ID: <7vljwb5o4p.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <237967ef0810260746w10e930c1sf36a2674f49afbe1@mail.gmail.com> (Mikael Magnusson's message of "Sun, 26 Oct 2008 15:46:39 +0100")

"Mikael Magnusson" <mikachu@gmail.com> writes:

> % mkdir 1; cd 1
> % echo > a; git add a; git commit -m a
> % cd ..
> % git clone -s 1 2
> % git push . master:master
> fatal: Could not switch to
> '/tmp/a/1/.git/objects/n:/usr/games/bin:/usr/local/ipod-chain'
> fatal: The remote end hung up unexpectedly

I think I see a bug in foreach_alt_odb() to add_refs_from_alternate()
callchain, but I cannot explain why the contents of $PATH leaks to the
error message.

Can you try this patch?

 sha1_file.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git i/sha1_file.c w/sha1_file.c
index ab2b520..98e7d7a 100644
--- i/sha1_file.c
+++ w/sha1_file.c
@@ -402,9 +402,11 @@ void foreach_alt_odb(alt_odb_fn fn, void *cb)
 	struct alternate_object_database *ent;
 
 	prepare_alt_odb();
-	for (ent = alt_odb_list; ent; ent = ent->next)
+	for (ent = alt_odb_list; ent; ent = ent->next) {
+		*ent->name = '\0';
 		if (fn(ent, cb))
 			return;
+	}
 }
 
 void prepare_alt_odb(void)

  reply	other threads:[~2008-10-26 16:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-26 14:46 Weird problem with long $PATH and alternates (bisected) Mikael Magnusson
2008-10-26 16:15 ` Junio C Hamano [this message]
2008-10-26 16:49   ` Mikael Magnusson
2008-10-26 17:53   ` René Scharfe
2008-10-26 18:07     ` Junio C Hamano
2008-10-26 18:29       ` Mikael Magnusson
2008-10-27  5:30         ` Junio C Hamano

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=7vljwb5o4p.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=mikachu@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 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).