@@ -284,30 +284,30 @@ static int edit_and_replace(const char *object_ref, int force, int raw)
284
284
{
285
285
char * tmpfile = git_pathdup ("REPLACE_EDITOBJ" );
286
286
enum object_type type ;
287
- struct object_id old , new , prev ;
287
+ struct object_id old_oid , new_oid , prev ;
288
288
struct strbuf ref = STRBUF_INIT ;
289
289
290
- if (get_oid (object_ref , & old ) < 0 )
290
+ if (get_oid (object_ref , & old_oid ) < 0 )
291
291
die ("Not a valid object name: '%s'" , object_ref );
292
292
293
- type = sha1_object_info (old .hash , NULL );
293
+ type = sha1_object_info (old_oid .hash , NULL );
294
294
if (type < 0 )
295
- die ("unable to get object type for %s" , oid_to_hex (& old ));
295
+ die ("unable to get object type for %s" , oid_to_hex (& old_oid ));
296
296
297
- check_ref_valid (& old , & prev , & ref , force );
297
+ check_ref_valid (& old_oid , & prev , & ref , force );
298
298
strbuf_release (& ref );
299
299
300
- export_object (& old , type , raw , tmpfile );
300
+ export_object (& old_oid , type , raw , tmpfile );
301
301
if (launch_editor (tmpfile , NULL , NULL ) < 0 )
302
302
die ("editing object file failed" );
303
- import_object (& new , type , raw , tmpfile );
303
+ import_object (& new_oid , type , raw , tmpfile );
304
304
305
305
free (tmpfile );
306
306
307
- if (!oidcmp (& old , & new ))
308
- return error ("new object is the same as the old one: '%s'" , oid_to_hex (& old ));
307
+ if (!oidcmp (& old_oid , & new_oid ))
308
+ return error ("new object is the same as the old one: '%s'" , oid_to_hex (& old_oid ));
309
309
310
- return replace_object_oid (object_ref , & old , "replacement" , & new , force );
310
+ return replace_object_oid (object_ref , & old_oid , "replacement" , & new_oid , force );
311
311
}
312
312
313
313
static void replace_parents (struct strbuf * buf , int argc , const char * * argv )
@@ -386,16 +386,16 @@ static void check_mergetags(struct commit *commit, int argc, const char **argv)
386
386
387
387
static int create_graft (int argc , const char * * argv , int force )
388
388
{
389
- struct object_id old , new ;
389
+ struct object_id old_oid , new_oid ;
390
390
const char * old_ref = argv [0 ];
391
391
struct commit * commit ;
392
392
struct strbuf buf = STRBUF_INIT ;
393
393
const char * buffer ;
394
394
unsigned long size ;
395
395
396
- if (get_oid (old_ref , & old ) < 0 )
396
+ if (get_oid (old_ref , & old_oid ) < 0 )
397
397
die (_ ("Not a valid object name: '%s'" ), old_ref );
398
- commit = lookup_commit_or_die (& old , old_ref );
398
+ commit = lookup_commit_or_die (& old_oid , old_ref );
399
399
400
400
buffer = get_commit_buffer (commit , & size );
401
401
strbuf_add (& buf , buffer , size );
@@ -410,15 +410,15 @@ static int create_graft(int argc, const char **argv, int force)
410
410
411
411
check_mergetags (commit , argc , argv );
412
412
413
- if (write_sha1_file (buf .buf , buf .len , commit_type , new .hash ))
413
+ if (write_sha1_file (buf .buf , buf .len , commit_type , new_oid .hash ))
414
414
die (_ ("could not write replacement commit for: '%s'" ), old_ref );
415
415
416
416
strbuf_release (& buf );
417
417
418
- if (!oidcmp (& old , & new ))
419
- return error ("new commit is the same as the old one: '%s'" , oid_to_hex (& old ));
418
+ if (!oidcmp (& old_oid , & new_oid ))
419
+ return error ("new commit is the same as the old one: '%s'" , oid_to_hex (& old_oid ));
420
420
421
- return replace_object_oid (old_ref , & old , "replacement" , & new , force );
421
+ return replace_object_oid (old_ref , & old_oid , "replacement" , & new_oid , force );
422
422
}
423
423
424
424
int cmd_replace (int argc , const char * * argv , const char * prefix )
0 commit comments