@@ -101,7 +101,7 @@ static void setup_archive_check(struct git_attr_check *check)
101
101
102
102
struct directory {
103
103
struct directory * up ;
104
- unsigned char sha1 [ 20 ] ;
104
+ struct object_id oid ;
105
105
int baselen , len ;
106
106
unsigned mode ;
107
107
int stage ;
@@ -177,7 +177,7 @@ static void queue_directory(const unsigned char *sha1,
177
177
d -> stage = stage ;
178
178
c -> bottom = d ;
179
179
d -> len = sprintf (d -> path , "%.*s%s/" , (int )base -> len , base -> buf , filename );
180
- hashcpy (d -> sha1 , sha1 );
180
+ hashcpy (d -> oid . hash , sha1 );
181
181
}
182
182
183
183
static int write_directory (struct archiver_context * c )
@@ -191,7 +191,7 @@ static int write_directory(struct archiver_context *c)
191
191
d -> path [d -> len - 1 ] = '\0' ; /* no trailing slash */
192
192
ret =
193
193
write_directory (c ) ||
194
- write_archive_entry (d -> sha1 , d -> path , d -> baselen ,
194
+ write_archive_entry (d -> oid . hash , d -> path , d -> baselen ,
195
195
d -> path + d -> baselen , d -> mode ,
196
196
d -> stage , c ) != READ_TREE_RECURSIVE ;
197
197
free (d );
@@ -354,23 +354,23 @@ static void parse_treeish_arg(const char **argv,
354
354
time_t archive_time ;
355
355
struct tree * tree ;
356
356
const struct commit * commit ;
357
- unsigned char sha1 [ 20 ] ;
357
+ struct object_id oid ;
358
358
359
359
/* Remotes are only allowed to fetch actual refs */
360
360
if (remote && !remote_allow_unreachable ) {
361
361
char * ref = NULL ;
362
362
const char * colon = strchrnul (name , ':' );
363
363
int refnamelen = colon - name ;
364
364
365
- if (!dwim_ref (name , refnamelen , sha1 , & ref ))
365
+ if (!dwim_ref (name , refnamelen , oid . hash , & ref ))
366
366
die ("no such ref: %.*s" , refnamelen , name );
367
367
free (ref );
368
368
}
369
369
370
- if (get_sha1 (name , sha1 ))
370
+ if (get_sha1 (name , oid . hash ))
371
371
die ("Not a valid object name" );
372
372
373
- commit = lookup_commit_reference_gently (sha1 , 1 );
373
+ commit = lookup_commit_reference_gently (oid . hash , 1 );
374
374
if (commit ) {
375
375
commit_sha1 = commit -> object .sha1 ;
376
376
archive_time = commit -> date ;
@@ -379,21 +379,21 @@ static void parse_treeish_arg(const char **argv,
379
379
archive_time = time (NULL );
380
380
}
381
381
382
- tree = parse_tree_indirect (sha1 );
382
+ tree = parse_tree_indirect (oid . hash );
383
383
if (tree == NULL )
384
384
die ("not a tree object" );
385
385
386
386
if (prefix ) {
387
- unsigned char tree_sha1 [ 20 ] ;
387
+ struct object_id tree_oid ;
388
388
unsigned int mode ;
389
389
int err ;
390
390
391
391
err = get_tree_entry (tree -> object .sha1 , prefix ,
392
- tree_sha1 , & mode );
392
+ tree_oid . hash , & mode );
393
393
if (err || !S_ISDIR (mode ))
394
394
die ("current working directory is untracked" );
395
395
396
- tree = parse_tree_indirect (tree_sha1 );
396
+ tree = parse_tree_indirect (tree_oid . hash );
397
397
}
398
398
ar_args -> tree = tree ;
399
399
ar_args -> commit_sha1 = commit_sha1 ;
0 commit comments