@@ -228,8 +228,6 @@ static int checkout_paths(const struct checkout_opts *opts,
228
228
int flag ;
229
229
struct commit * head ;
230
230
int errs = 0 ;
231
- int stage = opts -> writeout_stage ;
232
- int merge = opts -> merge ;
233
231
int newfd ;
234
232
struct lock_file * lock_file ;
235
233
@@ -327,8 +325,8 @@ static int checkout_paths(const struct checkout_opts *opts,
327
325
continue ;
328
326
if (opts -> force ) {
329
327
warning (_ ("path '%s' is unmerged" ), ce -> name );
330
- } else if (stage ) {
331
- errs |= check_stage (stage , ce , pos );
328
+ } else if (opts -> writeout_stage ) {
329
+ errs |= check_stage (opts -> writeout_stage , ce , pos );
332
330
} else if (opts -> merge ) {
333
331
errs |= check_stages ((1 <<2 ) | (1 <<3 ), ce , pos );
334
332
} else {
@@ -352,9 +350,9 @@ static int checkout_paths(const struct checkout_opts *opts,
352
350
errs |= checkout_entry (ce , & state , NULL );
353
351
continue ;
354
352
}
355
- if (stage )
356
- errs |= checkout_stage (stage , ce , pos , & state );
357
- else if (merge )
353
+ if (opts -> writeout_stage )
354
+ errs |= checkout_stage (opts -> writeout_stage , ce , pos , & state );
355
+ else if (opts -> merge )
358
356
errs |= checkout_merged (pos , & state );
359
357
pos = skip_same_name (ce , pos ) - 1 ;
360
358
}
0 commit comments