@@ -901,6 +901,7 @@ static int get_oid_basic(struct repository *r, const char *str, int len,
901
901
char * real_ref = NULL ;
902
902
int refs_found = 0 ;
903
903
int at , reflog_len , nth_prior = 0 ;
904
+ int fatal = !(flags & GET_OID_QUIETLY );
904
905
905
906
if (len == r -> hash_algo -> hexsz && !get_oid_hex (str , oid )) {
906
907
if (warn_ambiguous_refs && warn_on_object_refname_ambiguity ) {
@@ -955,11 +956,11 @@ static int get_oid_basic(struct repository *r, const char *str, int len,
955
956
956
957
if (!len && reflog_len )
957
958
/* allow "@{...}" to mean the current branch reflog */
958
- refs_found = repo_dwim_ref (r , "HEAD" , 4 , oid , & real_ref , 0 );
959
+ refs_found = repo_dwim_ref (r , "HEAD" , 4 , oid , & real_ref , ! fatal );
959
960
else if (reflog_len )
960
961
refs_found = repo_dwim_log (r , str , len , oid , & real_ref );
961
962
else
962
- refs_found = repo_dwim_ref (r , str , len , oid , & real_ref , 0 );
963
+ refs_found = repo_dwim_ref (r , str , len , oid , & real_ref , ! fatal );
963
964
964
965
if (!refs_found )
965
966
return -1 ;
0 commit comments