]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/index-pack.c
index-pack: skip collision check when not in repository
authorJeff King <peff@peff.net>
Fri, 16 Dec 2016 21:43:22 +0000 (16:43 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 16 Dec 2016 21:57:19 +0000 (13:57 -0800)
commit29401e15754518a0e63e00d6cabc5a5f2f9b0973
tree495ad9972f0561094c10857d3678cd46a7c0b7d8
parenta3c45d126012e01b23edc4923ffddffac61d703b
index-pack: skip collision check when not in repository

You can run "git index-pack path/to/foo.pack" outside of a
repository to generate an index file, or just to verify the
contents. There's no point in doing a collision check, since
we obviously do not have any objects to collide with.

The current code will blindly look in .git/objects based on
the result of setup_git_env(). That effectively gives us the
right answer (since we won't find any objects), but it's a
waste of time, and it conflicts with our desire to
eventually get rid of the "fallback to .git" behavior of
setup_git_env().

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/index-pack.c