From: Johannes Schindelin Date: Thu, 15 Sep 2005 23:21:18 GMT Subject: [PATCH] Look at both unpacked and packed objects for short name expansion Message-ID: 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 --- 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;