summaryrefslogtreecommitdiff
path: root/branch.h
diff options
context:
space:
mode:
authorGlen Choo <chooglen@google.com>2022-01-29 00:04:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-02-01 22:18:56 (GMT)
commit3f3e76082bc29ff647dff16de9f0145a4d582825 (patch)
tree202f07a599663c3f9659920b2051018852899a1c /branch.h
parentbc0893cf3b0ee376ef5b6ed293b1525480a9d720 (diff)
downloadgit-3f3e76082bc29ff647dff16de9f0145a4d582825.zip
git-3f3e76082bc29ff647dff16de9f0145a4d582825.tar.gz
git-3f3e76082bc29ff647dff16de9f0145a4d582825.tar.bz2
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>
Diffstat (limited to 'branch.h')
-rw-r--r--branch.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/branch.h b/branch.h
index cf3a4d3..509cfcc 100644
--- a/branch.h
+++ b/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.