]> git.ipfire.org Git - thirdparty/git.git/blobdiff - branch.c
The fifth batch
[thirdparty/git.git] / branch.c
index 621019fcf4bde0a0568dbae2a1055e12cf8df030..a83f7ecf895724a93f2e971fdb2799f2dce90409 100644 (file)
--- a/branch.c
+++ b/branch.c
@@ -377,7 +377,7 @@ int validate_branchname(const char *name, struct strbuf *ref)
                exit(code);
        }
 
-       return ref_exists(ref->buf);
+       return refs_ref_exists(get_main_ref_store(the_repository), ref->buf);
 }
 
 static int initialized_checked_out_branches;
@@ -623,7 +623,8 @@ void create_branch(struct repository *r,
                msg = xstrfmt("branch: Reset to %s", start_name);
        else
                msg = xstrfmt("branch: Created from %s", start_name);
-       transaction = ref_transaction_begin(&err);
+       transaction = ref_store_transaction_begin(get_main_ref_store(the_repository),
+                                                 &err);
        if (!transaction ||
                ref_transaction_update(transaction, ref.buf,
                                        &oid, forcing ? NULL : null_oid(),
@@ -738,7 +739,7 @@ static int submodule_create_branch(struct repository *r,
 }
 
 void create_branches_recursively(struct repository *r, const char *name,
-                                const char *start_commitish,
+                                const char *start_committish,
                                 const char *tracking_name, int force,
                                 int reflog, int quiet, enum branch_track track,
                                 int dry_run)
@@ -748,8 +749,8 @@ void create_branches_recursively(struct repository *r, const char *name,
        struct object_id super_oid;
        struct submodule_entry_list submodule_entry_list;
 
-       /* Perform dwim on start_commitish to get super_oid and branch_point. */
-       dwim_branch_start(r, start_commitish, BRANCH_TRACK_NEVER,
+       /* Perform dwim on start_committish to get super_oid and branch_point. */
+       dwim_branch_start(r, start_committish, BRANCH_TRACK_NEVER,
                          &branch_point, &super_oid);
 
        /*
@@ -772,7 +773,7 @@ void create_branches_recursively(struct repository *r, const char *name,
                                submodule_entry_list.entries[i].submodule->name);
                        if (advice_enabled(ADVICE_SUBMODULES_NOT_UPDATED))
                                advise(_("You may try updating the submodules using 'git checkout --no-recurse-submodules %s && git submodule update --init'"),
-                                      start_commitish);
+                                      start_committish);
                        exit(code);
                }
 
@@ -787,7 +788,7 @@ void create_branches_recursively(struct repository *r, const char *name,
                            name);
        }
 
-       create_branch(r, name, start_commitish, force, 0, reflog, quiet,
+       create_branch(r, name, start_committish, force, 0, reflog, quiet,
                      BRANCH_TRACK_NEVER, dry_run);
        if (dry_run)
                return;