DORMANTno replies

[PATCH] Look at both unpacked and packed objects for short name expansion

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:42:06
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>

---

 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;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help