commit: add repository argument to lookup_commit
[gitweb.git] / branch.c
index 9b2742de32a5ba073507edbd20dc5541646df4c0..ecd710d7308c9d2be85cd3bcde4fd9d38dec0edc 100644 (file)
--- a/branch.c
+++ b/branch.c
@@ -3,12 +3,13 @@
 #include "config.h"
 #include "branch.h"
 #include "refs.h"
+#include "refspec.h"
 #include "remote.h"
 #include "commit.h"
 #include "worktree.h"
 
 struct tracking {
-       struct refspec spec;
+       struct refspec_item spec;
        char *src;
        const char *remote;
        int matches;
@@ -218,8 +219,8 @@ int validate_new_branchname(const char *name, struct strbuf *ref, int force)
 static int check_tracking_branch(struct remote *remote, void *cb_data)
 {
        char *tracking_branch = cb_data;
-       struct refspec query;
-       memset(&query, 0, sizeof(struct refspec));
+       struct refspec_item query;
+       memset(&query, 0, sizeof(struct refspec_item));
        query.dst = tracking_branch;
        return !remote_find_tracking(remote, &query);
 }
@@ -301,7 +302,7 @@ void create_branch(const char *name, const char *start_name,
                break;
        }
 
-       if ((commit = lookup_commit_reference(&oid)) == NULL)
+       if ((commit = lookup_commit_reference(the_repository, &oid)) == NULL)
                die(_("Not a valid branch point: '%s'."), start_name);
        oidcpy(&oid, &commit->object.oid);