summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2014-01-13 11:33:29 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-01-13 11:33:29 -0800
commit0a8cb0355589cd4058be8b810a9fc608ef9b9a6c (patch)
tree99bc18bd1fa94ab831e85364691c2f5ae018ae91
parentUpdate draft release notes to 1.9 (diff)
parentsha1_name: don't resolve refs when core.warnambiguousrefs is false (diff)
downloadtgif-0a8cb0355589cd4058be8b810a9fc608ef9b9a6c.tar.xz
Merge branch 'br/sha1-name-40-hex-no-disambiguation'
When parsing a 40-hex string into the object name, the string is checked to see if it can be interpreted as a ref so that a warning can be given for ambiguity. The code kicked in even when the core.warnambiguousrefs is set to false to squelch this warning, in which case the cycles spent to look at the ref namespace were an expensive no-op, as the result was discarded without being used. * br/sha1-name-40-hex-no-disambiguation: sha1_name: don't resolve refs when core.warnambiguousrefs is false
-rw-r--r--sha1_name.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sha1_name.c b/sha1_name.c
index b1873d8113..a5578f718e 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -451,9 +451,9 @@ static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
int at, reflog_len, nth_prior = 0;
if (len == 40 && !get_sha1_hex(str, sha1)) {
- if (warn_on_object_refname_ambiguity) {
+ if (warn_ambiguous_refs && warn_on_object_refname_ambiguity) {
refs_found = dwim_ref(str, len, tmp_sha1, &real_ref);
- if (refs_found > 0 && warn_ambiguous_refs) {
+ if (refs_found > 0) {
warning(warn_msg, len, str);
if (advice_object_name_warning)
fprintf(stderr, "%s\n", _(object_name_msg));