File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -866,7 +866,6 @@ int cmd_format_rev(int argc,
866866 struct object_id oid ;
867867 struct object * object ;
868868 struct object * peeled ;
869- struct commit * commit ;
870869
871870 if (repo_get_oid (the_repository , scratch_buf .buf , & oid )) {
872871 fprintf (stderr , "Could not get sha1 for %s. Skipping.\n" ,
@@ -882,15 +881,15 @@ int cmd_format_rev(int argc,
882881 }
883882
884883 peeled = deref_tag (the_repository , object , scratch_buf .buf , 0 );
885- if (peeled && peeled -> type == OBJ_COMMIT )
886- commit = (struct commit * )peeled ;
887- if (!commit ) {
888- fprintf (stderr , "Could not get commit for %s. Skipping.\n" ,
884+ if (!peeled || peeled -> type != OBJ_COMMIT ) {
885+ fprintf (stderr ,
886+ "Could not get commit for %s. Skipping.\n" ,
889887 * argv );
890888 continue ;
891889 }
892890
893- get_format_rev (commit , & format_pp , & scratch_buf );
891+ get_format_rev ((struct commit * )peeled ,
892+ & format_pp , & scratch_buf );
894893 printf ("%s\n" , scratch_buf .buf );
895894 strbuf_release (& scratch_buf );
896895 }
You can’t perform that action at this time.
0 commit comments