mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
branch: add a dry_run parameter to create_branch()
Add a dry_run parameter to create_branch() such that dry_run = 1 will validate a new branch without trying to create it. This will be used in `git branch --recurse-submodules` to ensure that the new branch can be created in all submodules. Signed-off-by: Glen Choo <chooglen@google.com> Reviewed-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
bc0893cf3b
commit
3f3e76082b
5
branch.h
5
branch.h
@@ -62,11 +62,14 @@ void dwim_and_setup_tracking(struct repository *r, const char *new_ref,
|
||||
* - track causes the new branch to be configured to merge the remote branch
|
||||
* that start_name is a tracking branch for (if any).
|
||||
*
|
||||
* - dry_run causes the branch to be validated but not created.
|
||||
*
|
||||
*/
|
||||
void create_branch(struct repository *r,
|
||||
const char *name, const char *start_name,
|
||||
int force, int clobber_head_ok,
|
||||
int reflog, int quiet, enum branch_track track);
|
||||
int reflog, int quiet, enum branch_track track,
|
||||
int dry_run);
|
||||
|
||||
/*
|
||||
* Check if 'name' can be a valid name for a branch; die otherwise.
|
||||
|
||||
Reference in New Issue
Block a user