git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[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;
Next: Junio C Hamano
Message 1 of 3 in “Look at both unpacked and packed objects for short name expansion”
  1. Look at both unpacked and packed objects for short name expansionJohannes Schindelin, Sep 15, 2005
  2. Junio C HamanoSep 16, 2005
  3. Johannes SchindelinSep 16, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.