@@ -206,31 +206,31 @@ static int bisect_write(const char *state, const char *rev,
206
206
struct object_id oid ;
207
207
struct commit * commit ;
208
208
FILE * fp = NULL ;
209
- int retval = 0 ;
209
+ int res = 0 ;
210
210
211
211
if (!strcmp (state , terms -> term_bad )) {
212
212
strbuf_addf (& tag , "refs/bisect/%s" , state );
213
213
} else if (one_of (state , terms -> term_good , "skip" , NULL )) {
214
214
strbuf_addf (& tag , "refs/bisect/%s-%s" , state , rev );
215
215
} else {
216
- retval = error (_ ("Bad bisect_write argument: %s" ), state );
216
+ res = error (_ ("Bad bisect_write argument: %s" ), state );
217
217
goto finish ;
218
218
}
219
219
220
220
if (get_oid (rev , & oid )) {
221
- retval = error (_ ("couldn't get the oid of the rev '%s'" ), rev );
221
+ res = error (_ ("couldn't get the oid of the rev '%s'" ), rev );
222
222
goto finish ;
223
223
}
224
224
225
225
if (update_ref (NULL , tag .buf , & oid , NULL , 0 ,
226
226
UPDATE_REFS_MSG_ON_ERR )) {
227
- retval = -1 ;
227
+ res = -1 ;
228
228
goto finish ;
229
229
}
230
230
231
231
fp = fopen (git_path_bisect_log (), "a" );
232
232
if (!fp ) {
233
- retval = error_errno (_ ("couldn't open the file '%s'" ), git_path_bisect_log ());
233
+ res = error_errno (_ ("couldn't open the file '%s'" ), git_path_bisect_log ());
234
234
goto finish ;
235
235
}
236
236
@@ -244,7 +244,7 @@ static int bisect_write(const char *state, const char *rev,
244
244
if (fp )
245
245
fclose (fp );
246
246
strbuf_release (& tag );
247
- return retval ;
247
+ return res ;
248
248
}
249
249
250
250
static int check_and_set_terms (struct bisect_terms * terms , const char * cmd )
@@ -294,7 +294,7 @@ static const char need_bisect_start_warning[] =
294
294
static int bisect_next_check (const struct bisect_terms * terms ,
295
295
const char * current_term )
296
296
{
297
- int missing_good = 1 , missing_bad = 1 , retval = 0 ;
297
+ int missing_good = 1 , missing_bad = 1 , res = 0 ;
298
298
const char * bad_ref = xstrfmt ("refs/bisect/%s" , terms -> term_bad );
299
299
const char * good_glob = xstrfmt ("%s-*" , terms -> term_good );
300
300
@@ -308,7 +308,7 @@ static int bisect_next_check(const struct bisect_terms *terms,
308
308
goto finish ;
309
309
310
310
if (!current_term ) {
311
- retval = -1 ;
311
+ res = -1 ;
312
312
goto finish ;
313
313
}
314
314
@@ -329,21 +329,21 @@ static int bisect_next_check(const struct bisect_terms *terms,
329
329
*/
330
330
yesno = git_prompt (_ ("Are you sure [Y/n]? " ), PROMPT_ECHO );
331
331
if (starts_with (yesno , "N" ) || starts_with (yesno , "n" ))
332
- retval = -1 ;
332
+ res = -1 ;
333
333
goto finish ;
334
334
}
335
335
if (!is_empty_or_missing_file (git_path_bisect_start ())) {
336
- retval = error (_ (need_bad_and_good_revision_warning ),
336
+ res = error (_ (need_bad_and_good_revision_warning ),
337
337
vocab_bad , vocab_good , vocab_bad , vocab_good );
338
338
} else {
339
- retval = error (_ (need_bisect_start_warning ),
339
+ res = error (_ (need_bisect_start_warning ),
340
340
vocab_good , vocab_bad , vocab_good , vocab_bad );
341
341
}
342
342
343
343
finish :
344
344
free ((void * ) good_glob );
345
345
free ((void * ) bad_ref );
346
- return retval ;
346
+ return res ;
347
347
}
348
348
349
349
static int get_terms (struct bisect_terms * terms )
@@ -397,33 +397,33 @@ static int bisect_terms(struct bisect_terms *terms, const char *option)
397
397
398
398
static int bisect_append_log_quoted (const char * * argv )
399
399
{
400
- int retval = 0 ;
400
+ int res = 0 ;
401
401
FILE * fp = fopen (git_path_bisect_log (), "a" );
402
402
struct strbuf orig_args = STRBUF_INIT ;
403
403
404
404
if (!fp )
405
405
return -1 ;
406
406
407
407
if (fprintf (fp , "git bisect start" ) < 1 ) {
408
- retval = -1 ;
408
+ res = -1 ;
409
409
goto finish ;
410
410
}
411
411
412
412
sq_quote_argv (& orig_args , argv );
413
413
if (fprintf (fp , "%s\n" , orig_args .buf ) < 1 )
414
- retval = -1 ;
414
+ res = -1 ;
415
415
416
416
finish :
417
417
fclose (fp );
418
418
strbuf_release (& orig_args );
419
- return retval ;
419
+ return res ;
420
420
}
421
421
422
422
static int bisect_start (struct bisect_terms * terms , int no_checkout ,
423
423
const char * * argv , int argc )
424
424
{
425
425
int i , has_double_dash = 0 , must_write_terms = 0 , bad_seen = 0 ;
426
- int flags , pathspec_pos , retval = 0 ;
426
+ int flags , pathspec_pos , res = 0 ;
427
427
struct string_list revs = STRING_LIST_INIT_DUP ;
428
428
struct string_list states = STRING_LIST_INIT_DUP ;
429
429
struct strbuf start_head = STRBUF_INIT ;
@@ -524,7 +524,7 @@ static int bisect_start(struct bisect_terms *terms, int no_checkout,
524
524
argv_array_pushl (& argv , "checkout" , start_head .buf ,
525
525
"--" , NULL );
526
526
if (run_command_v_opt (argv .argv , RUN_GIT_CMD )) {
527
- retval = error (_ ("checking out '%s' failed."
527
+ res = error (_ ("checking out '%s' failed."
528
528
" Try 'git bisect start "
529
529
"<valid-branch>'." ),
530
530
start_head .buf );
@@ -572,12 +572,12 @@ static int bisect_start(struct bisect_terms *terms, int no_checkout,
572
572
573
573
if (no_checkout ) {
574
574
if (get_oid (start_head .buf , & oid ) < 0 ) {
575
- retval = error (_ ("invalid ref: '%s'" ), start_head .buf );
575
+ res = error (_ ("invalid ref: '%s'" ), start_head .buf );
576
576
goto finish ;
577
577
}
578
578
if (update_ref (NULL , "BISECT_HEAD" , & oid , NULL , 0 ,
579
579
UPDATE_REFS_MSG_ON_ERR )) {
580
- retval = -1 ;
580
+ res = -1 ;
581
581
goto finish ;
582
582
}
583
583
}
@@ -589,26 +589,26 @@ static int bisect_start(struct bisect_terms *terms, int no_checkout,
589
589
for (i = 0 ; i < states .nr ; i ++ )
590
590
if (bisect_write (states .items [i ].string ,
591
591
revs .items [i ].string , terms , 1 )) {
592
- retval = -1 ;
592
+ res = -1 ;
593
593
goto finish ;
594
594
}
595
595
596
596
if (must_write_terms && write_terms (terms -> term_bad ,
597
597
terms -> term_good )) {
598
- retval = -1 ;
598
+ res = -1 ;
599
599
goto finish ;
600
600
}
601
601
602
- retval = bisect_append_log_quoted (argv );
603
- if (retval )
604
- retval = -1 ;
602
+ res = bisect_append_log_quoted (argv );
603
+ if (res )
604
+ res = -1 ;
605
605
606
606
finish :
607
607
string_list_clear (& revs , 0 );
608
608
string_list_clear (& states , 0 );
609
609
strbuf_release (& start_head );
610
610
strbuf_release (& bisect_names );
611
- return retval ;
611
+ return res ;
612
612
}
613
613
614
614
int cmd_bisect__helper (int argc , const char * * argv , const char * prefix )
0 commit comments