@matheusbsbs / matheus-bagliano / commits / 75ea38df66
Fork 0

builtin-checkout.c: Remove unused prefix arguments in switch_branches path

This path doesn't actually care where in the tree you started out, since it must change the whole thing anyway. With the gratuitous bug removed, the argument is unused. Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Daniel Barkalow committed Feb 21, 2008 at 10:50 UTC 75ea38df66910dcb9d09f1320ae2787b5bc8211e
1 file changed +4 -6
builtin-checkout.c
+4 -6
@@ -205,8 +205,7 @@ static void setup_branch_path(struct branch_info *branch)
205 }
206
207 static int merge_working_tree(struct checkout_opts *opts,
208 - struct branch_info *old, struct branch_info *new,
209 - const char *prefix)
208 + struct branch_info *old, struct branch_info *new)
209 {
210 int ret;
211 struct lock_file *lock_file = xcalloc(1, sizeof(struct lock_file));
@@ -429,8 +428,7 @@ static void update_refs_for_switch(struct checkout_opts *opts,
428 adjust_to_tracking(new, opts);
429 }
430
432 -static int switch_branches(struct checkout_opts *opts,
433 - struct branch_info *new, const char *prefix)
431 +static int switch_branches(struct checkout_opts *opts, struct branch_info *new)
432 {
433 int ret = 0;
434 struct branch_info old;
@@ -471,7 +469,7 @@ static int switch_branches(struct checkout_opts *opts,
469 opts->force = 1;
470 }
471
474 - ret = merge_working_tree(opts, &old, new, prefix);
472 + ret = merge_working_tree(opts, &old, new);
473 if (ret)
474 return ret;
475
@@ -569,5 +567,5 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
567 die("Cannot switch branch to a non-commit.");
568 }
569
572 - return switch_branches(&opts, &new, prefix);
570 + return switch_branches(&opts, &new);
571 }