summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7dc24aa)
raw | patch | inline | side by side (parent: 7dc24aa)
author | Shawn O. Pearce <spearce@spearce.org> | |
Sat, 26 May 2007 05:25:11 +0000 (01:25 -0400) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 27 May 2007 03:28:08 +0000 (20:28 -0700) |
Not every input value passed to get_sha1 is an abbreviated SHA-1.
Its actually quite common for refs to be passed and for those
refs to resolve to full SHA-1s, in which case we may not need to
initialize the alternate object database list in this process.
I'm relocating the call to prepare_alt_odb closer to the code
that actually needs it to maintain the fix first introduced by
Junio in 99a19b43 (to avoid ambiguous SHA-1 abbreviations from
being accepted). This allows us to avoid the alt_odb list setup
if we won't actually need it.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Its actually quite common for refs to be passed and for those
refs to resolve to full SHA-1s, in which case we may not need to
initialize the alternate object database list in this process.
I'm relocating the call to prepare_alt_odb closer to the code
that actually needs it to maintain the fix first introduced by
Junio in 99a19b43 (to avoid ambiguous SHA-1 abbreviations from
being accepted). This allows us to avoid the alt_odb list setup
if we won't actually need it.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
sha1_name.c | patch | blob | history |
diff --git a/sha1_name.c b/sha1_name.c
index 55f25a2d3b49b1d565a9840b7dcfb2e22687cdd3..8dfceb2d7fc769c554e4b2d59cd41e7b04973533 100644 (file)
--- a/sha1_name.c
+++ b/sha1_name.c
int has_unpacked, has_packed;
unsigned char unpacked_sha1[20], packed_sha1[20];
+ prepare_alt_odb();
has_unpacked = find_short_object_filename(len, canonical, unpacked_sha1);
has_packed = find_short_packed_object(len, res, packed_sha1);
if (!has_unpacked && !has_packed)
const char *cp;
*mode = S_IFINVALID;
- prepare_alt_odb();
ret = get_sha1_1(name, namelen, sha1);
if (!ret)
return ret;