@@ -4213,7 +4213,6 @@ static void prep_temp_blob(struct index_state *istate,
4213
4213
}
4214
4214
4215
4215
static struct diff_tempfile * prepare_temp_file (struct repository * r ,
4216
- const char * name ,
4217
4216
struct diff_filespec * one )
4218
4217
{
4219
4218
struct diff_tempfile * temp = claim_diff_tempfile ();
@@ -4231,18 +4230,18 @@ static struct diff_tempfile *prepare_temp_file(struct repository *r,
4231
4230
4232
4231
if (!S_ISGITLINK (one -> mode ) &&
4233
4232
(!one -> oid_valid ||
4234
- reuse_worktree_file (r -> index , name , & one -> oid , 1 ))) {
4233
+ reuse_worktree_file (r -> index , one -> path , & one -> oid , 1 ))) {
4235
4234
struct stat st ;
4236
- if (lstat (name , & st ) < 0 ) {
4235
+ if (lstat (one -> path , & st ) < 0 ) {
4237
4236
if (errno == ENOENT )
4238
4237
goto not_a_valid_file ;
4239
- die_errno ("stat(%s)" , name );
4238
+ die_errno ("stat(%s)" , one -> path );
4240
4239
}
4241
4240
if (S_ISLNK (st .st_mode )) {
4242
4241
struct strbuf sb = STRBUF_INIT ;
4243
- if (strbuf_readlink (& sb , name , st .st_size ) < 0 )
4244
- die_errno ("readlink(%s)" , name );
4245
- prep_temp_blob (r -> index , name , temp , sb .buf , sb .len ,
4242
+ if (strbuf_readlink (& sb , one -> path , st .st_size ) < 0 )
4243
+ die_errno ("readlink(%s)" , one -> path );
4244
+ prep_temp_blob (r -> index , one -> path , temp , sb .buf , sb .len ,
4246
4245
(one -> oid_valid ?
4247
4246
& one -> oid : null_oid ()),
4248
4247
(one -> oid_valid ?
@@ -4251,7 +4250,7 @@ static struct diff_tempfile *prepare_temp_file(struct repository *r,
4251
4250
}
4252
4251
else {
4253
4252
/* we can borrow from the file in the work tree */
4254
- temp -> name = name ;
4253
+ temp -> name = one -> path ;
4255
4254
if (!one -> oid_valid )
4256
4255
oid_to_hex_r (temp -> hex , null_oid ());
4257
4256
else
@@ -4269,7 +4268,7 @@ static struct diff_tempfile *prepare_temp_file(struct repository *r,
4269
4268
else {
4270
4269
if (diff_populate_filespec (r , one , NULL ))
4271
4270
die ("cannot read data blob for %s" , one -> path );
4272
- prep_temp_blob (r -> index , name , temp ,
4271
+ prep_temp_blob (r -> index , one -> path , temp ,
4273
4272
one -> data , one -> size ,
4274
4273
& one -> oid , one -> mode );
4275
4274
}
@@ -4278,10 +4277,9 @@ static struct diff_tempfile *prepare_temp_file(struct repository *r,
4278
4277
4279
4278
static void add_external_diff_name (struct repository * r ,
4280
4279
struct strvec * argv ,
4281
- const char * name ,
4282
4280
struct diff_filespec * df )
4283
4281
{
4284
- struct diff_tempfile * temp = prepare_temp_file (r , name , df );
4282
+ struct diff_tempfile * temp = prepare_temp_file (r , df );
4285
4283
strvec_push (argv , temp -> name );
4286
4284
strvec_push (argv , temp -> hex );
4287
4285
strvec_push (argv , temp -> mode );
@@ -4308,11 +4306,9 @@ static void run_external_diff(const char *pgm,
4308
4306
strvec_push (& cmd .args , name );
4309
4307
4310
4308
if (one && two ) {
4311
- add_external_diff_name (o -> repo , & cmd .args , name , one );
4312
- if (!other )
4313
- add_external_diff_name (o -> repo , & cmd .args , name , two );
4314
- else {
4315
- add_external_diff_name (o -> repo , & cmd .args , other , two );
4309
+ add_external_diff_name (o -> repo , & cmd .args , one );
4310
+ add_external_diff_name (o -> repo , & cmd .args , two );
4311
+ if (other ) {
4316
4312
strvec_push (& cmd .args , other );
4317
4313
strvec_push (& cmd .args , xfrm_msg );
4318
4314
}
@@ -7034,7 +7030,7 @@ static char *run_textconv(struct repository *r,
7034
7030
struct strbuf buf = STRBUF_INIT ;
7035
7031
int err = 0 ;
7036
7032
7037
- temp = prepare_temp_file (r , spec -> path , spec );
7033
+ temp = prepare_temp_file (r , spec );
7038
7034
strvec_push (& child .args , pgm );
7039
7035
strvec_push (& child .args , temp -> name );
7040
7036
0 commit comments