Skip to content

Commit

Permalink
builtin-checkout.c: Remove unused prefix arguments in switch_branches…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
Daniel Barkalow authored and Junio C Hamano committed Feb 21, 2008
1 parent 6010d2d commit 75ea38d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions builtin-checkout.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ static void setup_branch_path(struct branch_info *branch)
}

static int merge_working_tree(struct checkout_opts *opts,
struct branch_info *old, struct branch_info *new,
const char *prefix)
struct branch_info *old, struct branch_info *new)
{
int ret;
struct lock_file *lock_file = xcalloc(1, sizeof(struct lock_file));
Expand Down Expand Up @@ -429,8 +428,7 @@ static void update_refs_for_switch(struct checkout_opts *opts,
adjust_to_tracking(new, opts);
}

static int switch_branches(struct checkout_opts *opts,
struct branch_info *new, const char *prefix)
static int switch_branches(struct checkout_opts *opts, struct branch_info *new)
{
int ret = 0;
struct branch_info old;
Expand Down Expand Up @@ -471,7 +469,7 @@ static int switch_branches(struct checkout_opts *opts,
opts->force = 1;
}

ret = merge_working_tree(opts, &old, new, prefix);
ret = merge_working_tree(opts, &old, new);
if (ret)
return ret;

Expand Down Expand Up @@ -569,5 +567,5 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
die("Cannot switch branch to a non-commit.");
}

return switch_branches(&opts, &new, prefix);
return switch_branches(&opts, &new);
}

0 comments on commit 75ea38d

Please sign in to comment.