git-bundle: assorted fixes
This patch fixes issues mentioned by Junio, Nico and Simon: - I forgot to convert the usage string when removing the "--" from the subcommands, - a style fix in the bundle_header, - use xread() instead of read(), - use write_or_die() instead of write(), - make the bundle header extensible, - fail if the whitespace after a sha1 of a reference is missing, - close() the fds passed to a subprocess, - in verify_bundle(), do not use "rev-list --stdin", but rather pass the revs directly (avoiding a fork()), - fix a corrupted comment in show_object(), and - fix the size check in index_pack. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:

committed by
Junio C Hamano

parent
2e0afafebd
commit
fa257b0554
@ -457,8 +457,9 @@ 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 (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 (S_ISREG(st.st_mode) &&
|
||||
lseek(input_fd, 0, SEEK_CUR) - input_len != st.st_size)
|
||||
die("pack has junk at the end");
|
||||
|
||||
if (!nr_deltas)
|
||||
return;
|
||||
|
Reference in New Issue
Block a user