@@ -179,7 +179,8 @@ static int parse_next_oid(const char **next, const char *end,
179179 (* next )++ ;
180180 * next = parse_arg (* next , & arg );
181181 if (arg .len ) {
182- if (repo_get_oid (the_repository , arg .buf , oid ))
182+ if (repo_get_oid_with_flags (the_repository , arg .buf , oid ,
183+ GET_OID_SKIP_AMBIGUITY_CHECK ))
183184 goto invalid ;
184185 } else {
185186 /* Without -z, an empty value means all zeros: */
@@ -197,7 +198,8 @@ static int parse_next_oid(const char **next, const char *end,
197198 * next += arg .len ;
198199
199200 if (arg .len ) {
200- if (repo_get_oid (the_repository , arg .buf , oid ))
201+ if (repo_get_oid_with_flags (the_repository , arg .buf , oid ,
202+ GET_OID_SKIP_AMBIGUITY_CHECK ))
201203 goto invalid ;
202204 } else if (flags & PARSE_SHA1_ALLOW_EMPTY ) {
203205 /* With -z, treat an empty value as all zeros: */
@@ -299,7 +301,8 @@ static void parse_cmd_symref_update(struct ref_transaction *transaction,
299301 die ("symref-update %s: expected old value" , refname );
300302
301303 if (!strcmp (old_arg , "oid" )) {
302- if (repo_get_oid (the_repository , old_target , & old_oid ))
304+ if (repo_get_oid_with_flags (the_repository , old_target , & old_oid ,
305+ GET_OID_SKIP_AMBIGUITY_CHECK ))
303306 die ("symref-update %s: invalid oid: %s" , refname , old_target );
304307
305308 have_old_oid = 1 ;
@@ -772,7 +775,8 @@ int cmd_update_ref(int argc,
772775 refname = argv [0 ];
773776 value = argv [1 ];
774777 oldval = argv [2 ];
775- if (repo_get_oid (the_repository , value , & oid ))
778+ if (repo_get_oid_with_flags (the_repository , value , & oid ,
779+ GET_OID_SKIP_AMBIGUITY_CHECK ))
776780 die ("%s: not a valid SHA1" , value );
777781 }
778782
@@ -783,7 +787,8 @@ int cmd_update_ref(int argc,
783787 * must not already exist:
784788 */
785789 oidclr (& oldoid , the_repository -> hash_algo );
786- else if (repo_get_oid (the_repository , oldval , & oldoid ))
790+ else if (repo_get_oid_with_flags (the_repository , oldval , & oldoid ,
791+ GET_OID_SKIP_AMBIGUITY_CHECK ))
787792 die ("%s: not a valid old SHA1" , oldval );
788793 }
789794
0 commit comments