From 4bd488ea7c56b673947b07511d26f2afc4ec0bd6 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Fri, 4 Nov 2016 12:30:12 -0400 Subject: create_branch: drop unused "head" parameter This function used to have the caller pass in the current value of HEAD, in order to make sure we didn't clobber HEAD. In 55c4a6730, that logic moved to validate_new_branchname(), which just resolves HEAD itself. The parameter to create_branch is now unused. Since we have to update and re-wrap the docstring describing the parameters anyway, let's take this opportunity to break it out into a list, which makes it easier to find the parameters. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- builtin/branch.c | 4 ++-- builtin/checkout.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'builtin') diff --git a/builtin/branch.c b/builtin/branch.c index 2ecde53bf8..6c3b570cf7 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -807,7 +807,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix) * create_branch takes care of setting up the tracking * info and making sure new_upstream is correct */ - create_branch(head, branch->name, new_upstream, 0, 0, 0, quiet, BRANCH_TRACK_OVERRIDE); + create_branch(branch->name, new_upstream, 0, 0, 0, quiet, BRANCH_TRACK_OVERRIDE); } else if (unset_upstream) { struct branch *branch = branch_get(argv[0]); struct strbuf buf = STRBUF_INIT; @@ -853,7 +853,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix) strbuf_release(&buf); branch_existed = ref_exists(branch->refname); - create_branch(head, argv[0], (argc == 2) ? argv[1] : head, + create_branch(argv[0], (argc == 2) ? argv[1] : head, force, reflog, 0, quiet, track); /* diff --git a/builtin/checkout.c b/builtin/checkout.c index d3b296880e..d561f7491d 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -628,7 +628,7 @@ static void update_refs_for_switch(const struct checkout_opts *opts, } } else - create_branch(old->name, opts->new_branch, new->name, + create_branch(opts->new_branch, new->name, opts->new_branch_force ? 1 : 0, opts->new_branch_log, opts->new_branch_force ? 1 : 0, -- cgit v1.2.3