Skip to content

Commit f6cea74

Browse files
sivaraamgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5f9953d commit f6cea74

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

branch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ N_("\n"
228228
"\"git push -u\" to set the upstream config as you push.");
229229

230230
void create_branch(const char *name, const char *start_name,
231-
int force, int reflog, int clobber_head,
231+
int force, int reflog, int clobber_head_ok,
232232
int quiet, enum branch_track track)
233233
{
234234
struct commit *commit;
@@ -244,7 +244,7 @@ void create_branch(const char *name, const char *start_name,
244244

245245
if (validate_new_branchname(name, &ref, force,
246246
track == BRANCH_TRACK_OVERRIDE ||
247-
clobber_head)) {
247+
clobber_head_ok)) {
248248
if (!force)
249249
dont_change_ref = 1;
250250
else

branch.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,17 @@
1515
*
1616
* - reflog creates a reflog for the branch
1717
*
18+
* - clobber_head_ok allows the currently checked out (hence existing)
19+
* branch to be overwritten; without 'force', it has no effect.
20+
*
21+
* - quiet suppresses tracking information
22+
*
1823
* - track causes the new branch to be configured to merge the remote branch
1924
* that start_name is a tracking branch for (if any).
2025
*/
2126
void create_branch(const char *name, const char *start_name,
2227
int force, int reflog,
23-
int clobber_head, int quiet, enum branch_track track);
28+
int clobber_head_ok, int quiet, enum branch_track track);
2429

2530
/*
2631
* Validates that the requested branch may be created, returning the

0 commit comments

Comments
 (0)