@@ -107,7 +107,7 @@ static int check_submodules_use_gitfiles(void)
107
107
return errs ;
108
108
}
109
109
110
- static int check_local_mod (unsigned char * head , int index_only )
110
+ static int check_local_mod (struct object_id * head , int index_only )
111
111
{
112
112
/*
113
113
* Items in list are already sorted in the cache order,
@@ -123,13 +123,13 @@ static int check_local_mod(unsigned char *head, int index_only)
123
123
struct string_list files_submodule = STRING_LIST_INIT_NODUP ;
124
124
struct string_list files_local = STRING_LIST_INIT_NODUP ;
125
125
126
- no_head = is_null_sha1 (head );
126
+ no_head = is_null_oid (head );
127
127
for (i = 0 ; i < list .nr ; i ++ ) {
128
128
struct stat st ;
129
129
int pos ;
130
130
const struct cache_entry * ce ;
131
131
const char * name = list .entry [i ].name ;
132
- unsigned char sha1 [ 20 ] ;
132
+ struct object_id oid ;
133
133
unsigned mode ;
134
134
int local_changes = 0 ;
135
135
int staged_changes = 0 ;
@@ -197,9 +197,9 @@ static int check_local_mod(unsigned char *head, int index_only)
197
197
* way as changed from the HEAD.
198
198
*/
199
199
if (no_head
200
- || get_tree_entry (head , name , sha1 , & mode )
200
+ || get_tree_entry (head -> hash , name , oid . hash , & mode )
201
201
|| ce -> ce_mode != create_ce_mode (mode )
202
- || hashcmp ( ce -> oid . hash , sha1 ))
202
+ || oidcmp ( & ce -> oid , & oid ))
203
203
staged_changes = 1 ;
204
204
205
205
/*
@@ -351,10 +351,10 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
351
351
* report no changes unless forced.
352
352
*/
353
353
if (!force ) {
354
- unsigned char sha1 [ 20 ] ;
355
- if (get_sha1 ("HEAD" , sha1 ))
356
- hashclr ( sha1 );
357
- if (check_local_mod (sha1 , index_only ))
354
+ struct object_id oid ;
355
+ if (get_oid ("HEAD" , & oid ))
356
+ oidclr ( & oid );
357
+ if (check_local_mod (& oid , index_only ))
358
358
exit (1 );
359
359
} else if (!index_only ) {
360
360
if (check_submodules_use_gitfiles ())
0 commit comments