Skip to content

Commit

Permalink
checkout: pass whole struct to parse_branchname_arg instead of indivi…
Browse files Browse the repository at this point in the history
…dual flags

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Nguyễn Thái Ngọc Duy authored and Junio C Hamano committed Jan 7, 2015
1 parent df56607 commit 10f102b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions builtin/checkout.c
Original file line number Diff line number Diff line change
Expand Up @@ -1079,11 +1079,12 @@ static void check_linked_checkouts(struct branch_info *new)
static int parse_branchname_arg(int argc, const char **argv,
int dwim_new_local_branch_ok,
struct branch_info *new,
struct tree **source_tree,
unsigned char rev[20],
const char **new_branch,
int force_detach)
struct checkout_opts *opts,
unsigned char rev[20])
{
struct tree **source_tree = &opts->source_tree;
const char **new_branch = &opts->new_branch;
int force_detach = opts->force_detach;
int argcount = 0;
unsigned char branch_rev[20];
const char *arg;
Expand Down Expand Up @@ -1420,9 +1421,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
opts.track == BRANCH_TRACK_UNSPECIFIED &&
!opts.new_branch;
int n = parse_branchname_arg(argc, argv, dwim_ok,
&new, &opts.source_tree,
rev, &opts.new_branch,
opts.force_detach);
&new, &opts, rev);
argv += n;
argc -= n;
}
Expand Down

0 comments on commit 10f102b

Please sign in to comment.