Merge branch 'do/gitweb-strict-export-conf-doc'
[gitweb.git] / builtin / branch.c
index c396c41533c38630378db370f1db30e99aad849b..1be727209b7ceaead46d0bc5e4b9666fbe7ef7a1 100644 (file)
@@ -716,8 +716,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
                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;
 
@@ -784,7 +783,8 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
                 * create_branch takes care of setting up the tracking
                 * info and making sure new_upstream is correct
                 */
-               create_branch(branch->name, new_upstream, 0, 0, 0, quiet, BRANCH_TRACK_OVERRIDE);
+               create_branch(the_repository, branch->name, new_upstream,
+                             0, 0, 0, quiet, BRANCH_TRACK_OVERRIDE);
        } else if (unset_upstream) {
                struct branch *branch = branch_get(argv[0]);
                struct strbuf buf = STRBUF_INIT;
@@ -809,18 +809,14 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
                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"));
 
                if (track == BRANCH_TRACK_OVERRIDE)
                        die(_("the '--set-upstream' option is no longer supported. Please use '--track' or '--set-upstream-to' instead."));
 
-               create_branch(argv[0], (argc == 2) ? argv[1] : head,
+               create_branch(the_repository,
+                             argv[0], (argc == 2) ? argv[1] : head,
                              force, 0, reflog, quiet, track);
 
        } else