]> Pileus Git - ~andy/git/commitdiff
Merge branch 'nd/warn-ambiguous-object-name'
authorJunio C Hamano <gitster@pobox.com>
Tue, 11 Jun 2013 20:31:07 +0000 (13:31 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 Jun 2013 20:31:07 +0000 (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
index a8deee6e6419a1e867e06e90a70300cd2e01b556,22abde9bc4edc5d90fa8e12e5e27654948955b23..54315cbd0a554bdeb1ace160a5df7cf6c485e559
+++ 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
index 94caa32f9213f59a627176ec8b4aea022f6b0f8f,24d5420b7add56e6b19ce58918bf8d2fbde8ed8d..fefe39ac5caf5a1e8b95683a4c8dcc443df16d32
+++ 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