summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 88f8f0a)
raw | patch | inline | side by side (parent: 88f8f0a)
author | Junio C Hamano <junkio@cox.net> | |
Mon, 3 Oct 2005 07:36:13 +0000 (00:36 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 3 Oct 2005 07:36:13 +0000 (00:36 -0700) |
Unlike cases where "no such object exists", the case where specified
prefix is ambiguous would confuse the user if we say "no such commit"
or such. Give an extra error message from the uniqueness check if
there are more than one objects that match the given prefix.
Signed-off-by: Junio C Hamano <junkio@cox.net>
prefix is ambiguous would confuse the user if we say "no such commit"
or such. Give an extra error message from the uniqueness check if
there are more than one objects that match the given prefix.
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 0225f3107eaac6cb2824a90f1e4ced66f0c33852..8920de1c45ce0a094fbc0b5ea2ca744ef27c6393 100644 (file)
--- a/sha1_name.c
+++ b/sha1_name.c
}
/* Both have unique ones -- do they match? */
if (memcmp(packed_sha1, unpacked_sha1, 20))
- return -1;
+ return error("short SHA1 %.*s is ambiguous.", len, canonical);
memcpy(sha1, packed_sha1, 20);
return 0;
}