Re: Bug report: stash in upstream caused remote fetch to fail

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: Bug report: stash in upstream caused remote fetch to fail

From: Matt Burke <hidden>
Date: 2016-06-15 22:59:32

I ran into the same (or similar) problem as reported in
<http://www.spinics.net/lists/git/msg173391.html>. I have a script
that, among other things, clones a git repository. Here's where it
does that:

+ git init -q
+ git fetch -q -fu ../../../other '+refs/*:refs/*'
fatal: bad object 9b985fbe6a2b783c16756077a8be261c94b6c197
error: ../../../other did not send all necessary objects

In ../../../other:

$ git rev-parse stash@{0}
9b985fbe6a2b783c16756077a8be261c94b6c197
$ grep stash .git/packed-refs
9b985fbe6a2b783c16756077a8be261c94b6c197 refs/stash
$ cat .git/refs/stash
9b985fbe6a2b783c16756077a8be261c94b6c197

I removed the line from packed-refs and removed the refs/stash file,
and the problem went away. Restoring packed-refs or refs/stash makes
the error occur again.

When this was reported before, Thomas Rast wrote:
Do you, by any chance, still have a copy of the upstream repo before you
trashed the stash?  It would be interesting to know whether there was
actually some repository corruption going on (that went unnoticed by
fsck, no less) or if there was a bug in the transmission.
I've still got the repository, and am happy to help debug this.

--
Matt

Re: Bug report: stash in upstream caused remote fetch to fail

From: Jeff King <hidden>
Date: 2016-06-15 22:59:36

On Fri, Jan 03, 2014 at 04:12:51PM -0500, Matt Burke wrote:
+ git init -q
+ git fetch -q -fu ../../../other '+refs/*:refs/*'
fatal: bad object 9b985fbe6a2b783c16756077a8be261c94b6c197
error: ../../../other did not send all necessary objects
I was going to ask you to send your repository, but I can easily
reproduce here. I guess people don't run into it because it's uncommon
to fetch the whole refs/ namespace from a non-bare repo (and bare repos
do not tend to have stashes). Here's a minimal reproduction recipe:

  git init repo &&
  cd repo &&
  echo content >foo &&
  git add . &&
  git commit -m foo &&
  echo more >>foo &&
  git stash &&
  git init --bare sub &&
  cd sub &&
  git fetch .. 'refs/*:refs/*'

It looks like we are not feeding refs/stash properly to pack-objects.
I'll try to take a closer look later today.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help