Merge branch 'nd/warn-ambiguous-object-name'
authorJunio C Hamano <gitster@pobox.com>
Tue, 11 Jun 2013 20:31:07 +0000 (11 13:31 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 Jun 2013 20:31:07 +0000 (11 13:31 -0700)
"git cmd <name>", when <name> happens to be a 40-hex string,
directly uses the 40-hex string as an object name, even if a ref
"refs/<some hierarchy>/<name>" exists.  This disambiguation order
is unlikely to change, but we should warn about the ambiguity just
like we warn when more than one refs/ hierachies share the same
name.

* nd/warn-ambiguous-object-name:
  get_sha1: warn about full or short object names that look like refs

1  2 
advice.c
advice.h
sha1_name.c

diff --cc advice.c
+++ b/advice.c
@@@ -13,7 -12,7 +13,8 @@@ int advice_commit_before_merge = 1
  int advice_resolve_conflict = 1;
  int advice_implicit_identity = 1;
  int advice_detached_head = 1;
 +int advice_set_upstream_failure = 1;
+ int advice_object_name_warning = 1;
  
  static struct {
        const char *name;
@@@ -32,7 -30,7 +33,8 @@@
        { "resolveconflict", &advice_resolve_conflict },
        { "implicitidentity", &advice_implicit_identity },
        { "detachedhead", &advice_detached_head },
 +      { "setupstreamfailure", &advice_set_upstream_failure },
+       { "object_name_warning", &advice_object_name_warning },
  
        /* make this an alias for backward compatibility */
        { "pushnonfastforward", &advice_push_update_rejected }
diff --cc advice.h
+++ b/advice.h
@@@ -16,7 -15,7 +16,8 @@@ extern int advice_commit_before_merge
  extern int advice_resolve_conflict;
  extern int advice_implicit_identity;
  extern int advice_detached_head;
 +extern int advice_set_upstream_failure;
+ extern int advice_object_name_warning;
  
  int git_default_advice_config(const char *var, const char *value);
  void advise(const char *advice, ...);
diff --cc sha1_name.c
Simple merge