@@ -201,7 +201,7 @@ static int checkout_merged(int pos, struct checkout *state)
201201}
202202
203203static int checkout_paths (struct tree * source_tree , const char * * pathspec ,
204- struct checkout_opts * opts )
204+ const char * prefix , struct checkout_opts * opts )
205205{
206206 int pos ;
207207 struct checkout state ;
@@ -231,7 +231,7 @@ static int checkout_paths(struct tree *source_tree, const char **pathspec,
231231 match_pathspec (pathspec , ce -> name , ce_namelen (ce ), 0 , ps_matched );
232232 }
233233
234- if (report_path_error (ps_matched , pathspec , 0 ))
234+ if (report_path_error (ps_matched , pathspec , prefix ))
235235 return 1 ;
236236
237237 /* "checkout -m path" to recreate conflicted state */
@@ -1063,7 +1063,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
10631063 if (1 < !!opts .writeout_stage + !!opts .force + !!opts .merge )
10641064 die (_ ("git checkout: --ours/--theirs, --force and --merge are incompatible when\nchecking out of the index." ));
10651065
1066- return checkout_paths (source_tree , pathspec , & opts );
1066+ return checkout_paths (source_tree , pathspec , prefix , & opts );
10671067 }
10681068
10691069 if (patch_mode )
0 commit comments