[PATCH] Look at both unpacked and packed objects for short name expansion
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Sep 15, 2005, 23:21 UTC
- Message-ID
- <Pine.LNX.4.63.0509160120470.3859@wgmdd8.biozentrum.uni-wuerzburg.de>
We used to check for a unique expansion in the unpacked objects, and if one was found, we forgot to check in the packed objects, too.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
sha1_name.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
213fff36f398fbbbee9b76a9d59339ba60f1d58c
diff --git a/sha1_name.c b/sha1_name.c --- a/sha1_name.c +++ b/sha1_name.c @@ -115,7 +115,8 @@ static int get_short_sha1(const char *na if (i < 4) return -1; if (find_short_object_filename(i, canonical, sha1)) - return 0; + /* do not allow non-unique short names */ + return find_short_packed_object(i, res, canonical)!=0?-1:0; if (find_short_packed_object(i, res, sha1)) return 0; return -1;