checkout: pass whole struct to parse_branchname_arg instead of individual flags

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Nguyễn Thái Ngọc Duy 2015-01-03 16:41:25 +07:00 committed by Junio C Hamano
parent df56607dff
commit 10f102be21

View File

@ -1079,11 +1079,12 @@ static void check_linked_checkouts(struct branch_info *new)
static int parse_branchname_arg(int argc, const char **argv, static int parse_branchname_arg(int argc, const char **argv,
int dwim_new_local_branch_ok, int dwim_new_local_branch_ok,
struct branch_info *new, struct branch_info *new,
struct tree **source_tree, struct checkout_opts *opts,
unsigned char rev[20], unsigned char rev[20])
const char **new_branch,
int force_detach)
{ {
struct tree **source_tree = &opts->source_tree;
const char **new_branch = &opts->new_branch;
int force_detach = opts->force_detach;
int argcount = 0; int argcount = 0;
unsigned char branch_rev[20]; unsigned char branch_rev[20];
const char *arg; const char *arg;
@ -1420,9 +1421,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
opts.track == BRANCH_TRACK_UNSPECIFIED && opts.track == BRANCH_TRACK_UNSPECIFIED &&
!opts.new_branch; !opts.new_branch;
int n = parse_branchname_arg(argc, argv, dwim_ok, int n = parse_branchname_arg(argc, argv, dwim_ok,
&new, &opts.source_tree, &new, &opts, rev);
rev, &opts.new_branch,
opts.force_detach);
argv += n; argv += n;
argc -= n; argc -= n;
} }