@@ -184,7 +184,7 @@ static const struct name_decoration *current_pointed_by_HEAD(const struct name_d
184184{
185185 const struct name_decoration * list , * head = NULL ;
186186 const char * branch_name = NULL ;
187- unsigned char unused [ 20 ] ;
187+ struct object_id unused ;
188188 int rru_flags ;
189189
190190 /* First find HEAD */
@@ -197,7 +197,7 @@ static const struct name_decoration *current_pointed_by_HEAD(const struct name_d
197197 return NULL ;
198198
199199 /* Now resolve and find the matching current branch */
200- branch_name = resolve_ref_unsafe ("HEAD" , 0 , unused , & rru_flags );
200+ branch_name = resolve_ref_unsafe ("HEAD" , 0 , unused . hash , & rru_flags );
201201 if (!(rru_flags & REF_ISSYMREF ))
202202 return NULL ;
203203
@@ -456,13 +456,13 @@ static void show_signature(struct rev_info *opt, struct commit *commit)
456456 strbuf_release (& signature );
457457}
458458
459- static int which_parent (const unsigned char * sha1 , const struct commit * commit )
459+ static int which_parent (const struct object_id * oid , const struct commit * commit )
460460{
461461 int nth ;
462462 const struct commit_list * parent ;
463463
464464 for (nth = 0 , parent = commit -> parents ; parent ; parent = parent -> next ) {
465- if (!hashcmp ( parent -> item -> object .oid . hash , sha1 ))
465+ if (!oidcmp ( & parent -> item -> object .oid , oid ))
466466 return nth ;
467467 nth ++ ;
468468 }
@@ -481,14 +481,14 @@ static void show_one_mergetag(struct commit *commit,
481481 void * data )
482482{
483483 struct rev_info * opt = (struct rev_info * )data ;
484- unsigned char sha1 [ 20 ] ;
484+ struct object_id oid ;
485485 struct tag * tag ;
486486 struct strbuf verify_message ;
487487 int status , nth ;
488488 size_t payload_size , gpg_message_offset ;
489489
490- hash_sha1_file (extra -> value , extra -> len , typename (OBJ_TAG ), sha1 );
491- tag = lookup_tag (sha1 );
490+ hash_sha1_file (extra -> value , extra -> len , typename (OBJ_TAG ), oid . hash );
491+ tag = lookup_tag (oid . hash );
492492 if (!tag )
493493 return ; /* error message already given */
494494
@@ -500,7 +500,7 @@ static void show_one_mergetag(struct commit *commit,
500500 & commit -> parents -> next -> item -> object .oid ))
501501 strbuf_addf (& verify_message ,
502502 "merged tag '%s'\n" , tag -> tag );
503- else if ((nth = which_parent (tag -> tagged -> oid . hash , commit )) < 0 )
503+ else if ((nth = which_parent (& tag -> tagged -> oid , commit )) < 0 )
504504 strbuf_addf (& verify_message , "tag %s names a non-parent %s\n" ,
505505 tag -> tag , tag -> tagged -> oid .hash );
506506 else
@@ -536,7 +536,7 @@ void show_log(struct rev_info *opt)
536536 struct strbuf msgbuf = STRBUF_INIT ;
537537 struct log_info * log = opt -> loginfo ;
538538 struct commit * commit = log -> commit , * parent = log -> parent ;
539- int abbrev_commit = opt -> abbrev_commit ? opt -> abbrev : 40 ;
539+ int abbrev_commit = opt -> abbrev_commit ? opt -> abbrev : GIT_SHA1_HEXSZ ;
540540 const char * extra_headers = opt -> extra_headers ;
541541 struct pretty_print_context ctx = {0 };
542542
0 commit comments