git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Add git-bundle: move objects and references by archive

From
Nicolas Pitre <nico@cam.org>
Date
Feb 22, 2007, 16:24 UTC
Message-ID
<alpine.LRH.0.82.0702221117080.27932@xanadu.home>
In-Reply-To
<Pine.LNX.4.63.0702221654131.22628@wbgn013.biozentrum.uni-wuerzburg.de>
On Thu, 22 Feb 2007, Johannes Schindelin wrote:
Show 26 quoted lines
> Hi,
> 
> On Wed, 21 Feb 2007, Nicolas Pitre wrote:
> 
> > On Thu, 22 Feb 2007, Johannes Schindelin wrote:
> > 
> > > diff --git a/index-pack.c b/index-pack.c
> > > index fa9a0e7..5ccf4c4 100644
> > > --- a/index-pack.c
> > > +++ b/index-pack.c
> > > @@ -457,8 +457,8 @@ static void parse_pack_objects(unsigned char *sha1)
> > >  	/* If input_fd is a file, we should have reached its end now. */
> > >  	if (fstat(input_fd, &st))
> > >  		die("cannot fstat packfile: %s", strerror(errno));
> > > -	if (S_ISREG(st.st_mode) && st.st_size != consumed_bytes)
> > > -		die("pack has junk at the end");
> > > +	if (input_fd && S_ISREG(st.st_mode) && st.st_size != consumed_bytes)
> > > +		die("pack has junk at the end: 0%o, %d, %d %d", st.st_mode, (int)st.st_size, (int)consumed_bytes, input_fd);
> > >  
> > >  	if (!nr_deltas)
> > >  		return;
> > 
> > What is this supposed to mean?
> 
> The funny thing is, if you stream part of the bundle file to index-pack, 
> S_ISREG(st.st_mode) is true, even if input_fd == 0.
Hmmmm. indeed..

Could you please make the test, including the call to fstat(), conditional on !from_stdin instead?

Also I don't see the point of displaying the mode since we know that S_ISREG(st.st_mode) is true, and input_fd is of little interest as well.

Nicolas
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 9 of 28 in “Add git-bundle: move objects and references by archive”
  1. Add git-bundle: move objects and references by archiveJohannes Schindelin, Feb 22, 2007
  2. Nicolas PitreFeb 22, 2007
  3. Johannes SchindelinFeb 22, 2007
  4. Simon 'corecode' SchubertFeb 22, 2007
  5. Nicolas PitreFeb 22, 2007
  6. Johannes SchindelinFeb 22, 2007
  7. Simon 'corecode' SchubertFeb 22, 2007
  8. Johannes SchindelinFeb 22, 2007
  9. Nicolas PitreFeb 22, 2007
  10. Johannes SchindelinFeb 22, 2007
  11. Nicolas PitreFeb 22, 2007
  12. Junio C HamanoFeb 22, 2007
  13. Junio C HamanoFeb 22, 2007
  14. Johannes SchindelinFeb 22, 2007
  15. Junio C HamanoFeb 22, 2007
  16. Johannes SchindelinFeb 22, 2007
  17. Junio C HamanoFeb 22, 2007
  18. Johannes SchindelinFeb 22, 2007
  19. Johannes SchindelinFeb 22, 2007
  20. Mark LevedahlFeb 23, 2007
  21. Junio C HamanoFeb 23, 2007
  22. Johannes SixtFeb 22, 2007
  23. git-bundle: assorted fixesJohannes Schindelin, Feb 22, 2007
  24. Mark LevedahlFeb 23, 2007
  25. Johannes SchindelinFeb 23, 2007
  26. Mark LevedahlFeb 23, 2007
  27. Johannes SchindelinFeb 23, 2007
  28. Mark LevedahlFeb 23, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.