From f6cea74de63c2926a15b711bec09ed3ab34c2c1e Mon Sep 17 00:00:00 2001 From: Kaartic Sivaraam Date: Sat, 18 Nov 2017 22:56:45 +0530 Subject: branch: improve documentation and naming of create_branch() parameters The documentation for 'create_branch()' was incomplete as it didn't say what certain parameters were used for. Further a parameter name wasn't very communicative. So, add missing documentation for the sake of completeness and easy reference. Also, rename the concerned parameter to make its name more communicative. Signed-off-by: Kaartic Sivaraam Signed-off-by: Junio C Hamano --- branch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'branch.c') diff --git a/branch.c b/branch.c index 62f7b0d8c2..3e8d2f93f8 100644 --- a/branch.c +++ b/branch.c @@ -228,7 +228,7 @@ N_("\n" "\"git push -u\" to set the upstream config as you push."); void create_branch(const char *name, const char *start_name, - int force, int reflog, int clobber_head, + int force, int reflog, int clobber_head_ok, int quiet, enum branch_track track) { struct commit *commit; @@ -244,7 +244,7 @@ void create_branch(const char *name, const char *start_name, if (validate_new_branchname(name, &ref, force, track == BRANCH_TRACK_OVERRIDE || - clobber_head)) { + clobber_head_ok)) { if (!force) dont_change_ref = 1; else -- cgit v1.2.3 From e2bbd0cc4c1b661cc04620a6704003793b190e7e Mon Sep 17 00:00:00 2001 From: Kaartic Sivaraam Date: Sat, 18 Nov 2017 22:56:46 +0530 Subject: branch: group related arguments of create_branch() 39bd6f726 (Allow checkout -B to update the current branch, 2011-11-26) added 'clobber_head' (now, 'clobber_head_ok') "before" 'track' as 'track' was closely related 'clobber_head' for the purpose the commit wanted to achieve. Looking from the perspective of how the arguments are used it turns out that 'clobber_head' is more related to 'force' than it is to 'track'. So, re-order the arguments to keep the related arguments close to each other. Signed-off-by: Kaartic Sivaraam Signed-off-by: Junio C Hamano --- branch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'branch.c') diff --git a/branch.c b/branch.c index 3e8d2f93f8..bd607ae979 100644 --- a/branch.c +++ b/branch.c @@ -228,7 +228,7 @@ N_("\n" "\"git push -u\" to set the upstream config as you push."); void create_branch(const char *name, const char *start_name, - int force, int reflog, int clobber_head_ok, + int force, int clobber_head_ok, int reflog, int quiet, enum branch_track track) { struct commit *commit; -- cgit v1.2.3