@@ -58,7 +58,7 @@ struct recent_data {
5858 unsigned long timestamp ;
5959};
6060
61- static void add_recent_object (const unsigned char * sha1 ,
61+ static void add_recent_object (const struct object_id * oid ,
6262 unsigned long mtime ,
6363 struct recent_data * data )
6464{
@@ -75,37 +75,37 @@ static void add_recent_object(const unsigned char *sha1,
7575 * later processing, and the revision machinery expects
7676 * commits and tags to have been parsed.
7777 */
78- type = sha1_object_info (sha1 , NULL );
78+ type = sha1_object_info (oid -> hash , NULL );
7979 if (type < 0 )
80- die ("unable to get object info for %s" , sha1_to_hex ( sha1 ));
80+ die ("unable to get object info for %s" , oid_to_hex ( oid ));
8181
8282 switch (type ) {
8383 case OBJ_TAG :
8484 case OBJ_COMMIT :
85- obj = parse_object_or_die (sha1 , NULL );
85+ obj = parse_object_or_die (oid -> hash , NULL );
8686 break ;
8787 case OBJ_TREE :
88- obj = (struct object * )lookup_tree (sha1 );
88+ obj = (struct object * )lookup_tree (oid -> hash );
8989 break ;
9090 case OBJ_BLOB :
91- obj = (struct object * )lookup_blob (sha1 );
91+ obj = (struct object * )lookup_blob (oid -> hash );
9292 break ;
9393 default :
9494 die ("unknown object type for %s: %s" ,
95- sha1_to_hex ( sha1 ), typename (type ));
95+ oid_to_hex ( oid ), typename (type ));
9696 }
9797
9898 if (!obj )
99- die ("unable to lookup %s" , sha1_to_hex ( sha1 ));
99+ die ("unable to lookup %s" , oid_to_hex ( oid ));
100100
101101 add_pending_object (data -> revs , obj , "" );
102102}
103103
104- static int add_recent_loose (const unsigned char * sha1 ,
104+ static int add_recent_loose (const struct object_id * oid ,
105105 const char * path , void * data )
106106{
107107 struct stat st ;
108- struct object * obj = lookup_object (sha1 );
108+ struct object * obj = lookup_object (oid -> hash );
109109
110110 if (obj && obj -> flags & SEEN )
111111 return 0 ;
@@ -119,22 +119,22 @@ static int add_recent_loose(const unsigned char *sha1,
119119 */
120120 if (errno == ENOENT )
121121 return 0 ;
122- return error_errno ("unable to stat %s" , sha1_to_hex ( sha1 ));
122+ return error_errno ("unable to stat %s" , oid_to_hex ( oid ));
123123 }
124124
125- add_recent_object (sha1 , st .st_mtime , data );
125+ add_recent_object (oid , st .st_mtime , data );
126126 return 0 ;
127127}
128128
129- static int add_recent_packed (const unsigned char * sha1 ,
129+ static int add_recent_packed (const struct object_id * oid ,
130130 struct packed_git * p , uint32_t pos ,
131131 void * data )
132132{
133- struct object * obj = lookup_object (sha1 );
133+ struct object * obj = lookup_object (oid -> hash );
134134
135135 if (obj && obj -> flags & SEEN )
136136 return 0 ;
137- add_recent_object (sha1 , p -> mtime , data );
137+ add_recent_object (oid , p -> mtime , data );
138138 return 0 ;
139139}
140140
0 commit comments