@@ -228,8 +228,6 @@ static int checkout_paths(const struct checkout_opts *opts,
228228 int flag ;
229229 struct commit * head ;
230230 int errs = 0 ;
231- int stage = opts -> writeout_stage ;
232- int merge = opts -> merge ;
233231 int newfd ;
234232 struct lock_file * lock_file ;
235233
@@ -327,8 +325,8 @@ static int checkout_paths(const struct checkout_opts *opts,
327325 continue ;
328326 if (opts -> force ) {
329327 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 );
332330 } else if (opts -> merge ) {
333331 errs |= check_stages ((1 <<2 ) | (1 <<3 ), ce , pos );
334332 } else {
@@ -352,9 +350,9 @@ static int checkout_paths(const struct checkout_opts *opts,
352350 errs |= checkout_entry (ce , & state , NULL );
353351 continue ;
354352 }
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 )
358356 errs |= checkout_merged (pos , & state );
359357 pos = skip_same_name (ce , pos ) - 1 ;
360358 }
0 commit comments