summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2015-01-03 16:41:25 +0700
committerJunio C Hamano <gitster@pobox.com>2015-01-07 10:23:04 -0800
commit10f102be211cf1ba61c983fb463665147052daa9 (patch)
treecbf07143734e247a4fbdd9b2ffe262005aad5fb3
parentdf56607dff2d656043a1f77a647f97a0a6b5aec9 (diff)
downloadgit-10f102be211cf1ba61c983fb463665147052daa9.tar.gz
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>
-rw-r--r--builtin/checkout.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 953b76370b..d8717efb07 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -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;
@@ -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;
}