--- v8
+++ v5
@@ -1,20 +1,20 @@
-Consolidate the logic for deciding when to create a new branch in
-cmd_branch(), and save the result for reuse. Besides making the function
-more explicit, this allows us to validate options that can only be used
-when creating a branch. Such an option does not exist yet, but one will
-be introduced in a subsequent commit.
+Add a variable to cmd_branch() that will tell us whether or not
+cmd_branch() will default to creating a branch (instead of performing
+another action). Besides making the function more explicit, this allows
+us to validate options that can only be used when creating a branch.
+Such an option does not exist yet, but one will be introduced in a
+subsequent commit.
-Helped-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Glen Choo <chooglen@google.com>
---
builtin/branch.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/builtin/branch.c b/builtin/branch.c
-index c6fffb99ab..b352cc789a 100644
+index d785ebdba0..6c0069bf00 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
-@@ -616,14 +616,15 @@ static int edit_branch_description(const char *branch_name)
+@@ -621,14 +621,15 @@ static int edit_branch_description(const char *branch_name)
int cmd_branch(int argc, const char **argv, const char *prefix)
{
@@ -32,10 +32,10 @@
enum branch_track track;
struct ref_filter filter;
- int icase = 0;
- static struct ref_sorting *sorting = NULL, **sorting_tail = &sorting;
+ static struct ref_sorting *sorting;
+ struct string_list sorting_options = STRING_LIST_INIT_DUP;
struct ref_format format = REF_FORMAT_INIT;
-
-@@ -707,8 +708,10 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
+@@ -713,8 +714,10 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
filter.reachable_from || filter.unreachable_from || filter.points_at.nr)
list = 1;
@@ -48,7 +48,7 @@
usage_with_options(builtin_branch_usage, options);
if (filter.abbrev == -1)
-@@ -848,7 +851,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
+@@ -854,7 +857,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
strbuf_addf(&buf, "branch.%s.merge", branch->name);
git_config_set_multivar(buf.buf, NULL, NULL, CONFIG_FLAGS_MULTI_REPLACE);
strbuf_release(&buf);