diff options
| author | Glen Choo <chooglen@google.com> | 2022-01-28 16:04:43 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-02-01 14:18:56 -0800 |
| commit | 3f3e76082bc29ff647dff16de9f0145a4d582825 (patch) | |
| tree | 202f07a599663c3f9659920b2051018852899a1c /builtin/checkout.c | |
| parent | bc0893cf3b0ee376ef5b6ed293b1525480a9d720 (diff) | |
| download | git-3f3e76082bc29ff647dff16de9f0145a4d582825.tar.gz | |
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 'builtin/checkout.c')
| -rw-r--r-- | builtin/checkout.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c index 1809ac12df..8600860629 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -893,7 +893,8 @@ static void update_refs_for_switch(const struct checkout_opts *opts, opts->new_branch_force ? 1 : 0, opts->new_branch_log, opts->quiet, - opts->track); + opts->track, + 0); new_branch_info->name = opts->new_branch; setup_branch_path(new_branch_info); } |
