Merge branch 'tq/branch-style-fix'
authorJunio C Hamano <gitster@pobox.com>
Tue, 30 Oct 2018 06:43:43 +0000 (15:43 +0900)
committerJunio C Hamano <gitster@pobox.com>
Tue, 30 Oct 2018 06:43:43 +0000 (15:43 +0900)
Code clean-up.

* tq/branch-style-fix:
branch: trivial style fix

1  2 
builtin/branch.c
diff --combined builtin/branch.c
index 236770303468050c60b109cda32fa13915e07656,1f3c7e386767a1a0a461ad123566377c4c568d59..0c55f7f065d6ceb34d27a165160192fabe9f22d1
@@@ -23,7 -23,6 +23,7 @@@
  #include "ref-filter.h"
  #include "worktree.h"
  #include "help.h"
 +#include "commit-reach.h"
  
  static const char * const builtin_branch_usage[] = {
        N_("git branch [<options>] [-r | -a] [--merged | --no-merged]"),
@@@ -38,6 -37,7 +38,6 @@@
  
  static const char *head;
  static struct object_id head_oid;
 -static int used_deprecated_reflog_option;
  
  static int branch_use_color = -1;
  static char branch_colors[][COLOR_MAXLEN] = {
@@@ -578,6 -578,14 +578,6 @@@ static int edit_branch_description(cons
        return 0;
  }
  
 -static int deprecated_reflog_option_cb(const struct option *opt,
 -                                     const char *arg, int unset)
 -{
 -      used_deprecated_reflog_option = 1;
 -      *(int *)opt->value = !unset;
 -      return 0;
 -}
 -
  int cmd_branch(int argc, const char **argv, const char *prefix)
  {
        int delete = 0, rename = 0, copy = 0, force = 0, list = 0;
                OPT_BIT('M', NULL, &rename, N_("move/rename a branch, even if target exists"), 2),
                OPT_BIT('c', "copy", &copy, N_("copy a branch and its reflog"), 1),
                OPT_BIT('C', NULL, &copy, N_("copy a branch, even if target exists"), 2),
 -              OPT_BOOL(0, "list", &list, N_("list branch names")),
 +              OPT_BOOL('l', "list", &list, N_("list branch names")),
                OPT_BOOL(0, "create-reflog", &reflog, N_("create the branch's reflog")),
 -              {
 -                      OPTION_CALLBACK, 'l', NULL, &reflog, NULL,
 -                      N_("deprecated synonym for --create-reflog"),
 -                      PARSE_OPT_NOARG | PARSE_OPT_HIDDEN,
 -                      deprecated_reflog_option_cb
 -              },
                OPT_BOOL(0, "edit-description", &edit_description,
                         N_("edit the description for the branch")),
                OPT__FORCE(&force, N_("force creation, move/rename, deletion"), PARSE_OPT_NOCOMPLETE),
        if (list)
                setup_auto_pager("branch", 1);
  
 -      if (used_deprecated_reflog_option && !list) {
 -              warning("the '-l' alias for '--create-reflog' is deprecated;");
 -              warning("it will be removed in a future version of Git");
 -      }
 -
        if (delete) {
                if (!argc)
                        die(_("branch name required"));
                print_columns(&output, colopts, NULL);
                string_list_clear(&output, 0);
                return 0;
-       }
-       else if (edit_description) {
+       } else if (edit_description) {
                const char *branch_name;
                struct strbuf branch_ref = STRBUF_INIT;
  
                git_config_set_multivar(buf.buf, NULL, NULL, 1);
                strbuf_release(&buf);
        } else if (argc > 0 && argc <= 2) {
 -              struct branch *branch = branch_get(argv[0]);
 -
 -              if (!branch)
 -                      die(_("no such branch '%s'"), argv[0]);
 -
                if (filter.kind != FILTER_REFS_BRANCHES)
                        die(_("-a and -r options to 'git branch' do not make sense with a branch name"));