From: Mikael Magnusson Date: Sun, 26 Oct 2008 16:49:53 GMT Subject: Re: Weird problem with long $PATH and alternates (bisected) Message-ID: <237967ef0810260949q37e474e2y51a7ac6754dc0554@mail.gmail.com> In-Reply-To: <7vljwb5o4p.fsf@gitster.siamese.dyndns.org> 2008/10/26 Junio C Hamano : > "Mikael Magnusson" 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? Yeah this fixes the issue for me. If I add this static int add_refs_from_alternate(struct alternate_object_database *e, void *unused) { + fprintf(stderr, "add: %s\n", e->base); char *other = xstrdup(make_absolute_path(e->base)); size_t len = strlen(other); and prepare_alt_odb(); for (ent = alt_odb_list; ent; ent = ent->next) { fprintf(stderr, "for: %s\n", ent->name); if (fn(ent, cb)) return; then i get for: in//usr/qt/3/bin:/usr/games/bin:/usr/loca add: /tmp/a/1/.git/objects/in//usr/qt/3/bin:/usr/games/bin:/usr/loca fatal: Could not switch to '/tmp/a/1/.git/objects/in//usr/qt/3/bin:/usr/games/bin:/usr' fatal: The remote end hung up unexpectedly -- Mikael Magnusson