]> git.ipfire.org Git - thirdparty/git.git/blobdiff - remote.c
object-name.h: move declarations for object-name.c functions from cache.h
[thirdparty/git.git] / remote.c
index 60869beebe7364a594cd45938d4ed97dcdd28840..3afedce593e31c716e7a1e9ef8ffd890c79596bf 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -1,15 +1,22 @@
 #include "cache.h"
+#include "abspath.h"
+#include "alloc.h"
 #include "config.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
 #include "remote.h"
 #include "urlmatch.h"
 #include "refs.h"
 #include "refspec.h"
+#include "object-name.h"
 #include "object-store.h"
 #include "commit.h"
 #include "diff.h"
 #include "revision.h"
 #include "dir.h"
 #include "tag.h"
+#include "setup.h"
 #include "string-list.h"
 #include "strvec.h"
 #include "commit-reach.h"
@@ -1163,7 +1170,7 @@ static int try_explicit_object_name(const char *name,
                return 0;
        }
 
-       if (get_oid(name, &oid))
+       if (repo_get_oid(the_repository, name, &oid))
                return -1;
 
        if (match) {
@@ -1251,7 +1258,7 @@ static void show_push_unqualified_ref_name_error(const char *dst_value,
        if (!advice_enabled(ADVICE_PUSH_UNQUALIFIED_REF_NAME))
                return;
 
-       if (get_oid(matched_src_name, &oid))
+       if (repo_get_oid(the_repository, matched_src_name, &oid))
                BUG("'%s' is not a valid object, "
                    "match_explicit_lhs() should catch this!",
                    matched_src_name);
@@ -1759,7 +1766,7 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror,
                if (!reject_reason && !ref->deletion && !is_null_oid(&ref->old_oid)) {
                        if (starts_with(ref->name, "refs/tags/"))
                                reject_reason = REF_STATUS_REJECT_ALREADY_EXISTS;
-                       else if (!has_object_file(&ref->old_oid))
+                       else if (!repo_has_object_file(the_repository, &ref->old_oid))
                                reject_reason = REF_STATUS_REJECT_FETCH_FIRST;
                        else if (!lookup_commit_reference_gently(the_repository, &ref->old_oid, 1) ||
                                 !lookup_commit_reference_gently(the_repository, &ref->new_oid, 1))
@@ -1808,8 +1815,9 @@ static void set_merge(struct remote_state *remote_state, struct branch *ret)
                if (!remote_find_tracking(remote, ret->merge[i]) ||
                    strcmp(ret->remote_name, "."))
                        continue;
-               if (dwim_ref(ret->merge_name[i], strlen(ret->merge_name[i]),
-                            &oid, &ref, 0) == 1)
+               if (repo_dwim_ref(the_repository, ret->merge_name[i],
+                                 strlen(ret->merge_name[i]), &oid, &ref,
+                                 0) == 1)
                        ret->merge[i]->dst = ref;
                else
                        ret->merge[i]->dst = xstrdup(ret->merge_name[i]);
@@ -2505,7 +2513,7 @@ static int parse_push_cas_option(struct push_cas_option *cas, const char *arg, i
                entry->use_tracking = 1;
        else if (!colon[1])
                oidclr(&entry->expect);
-       else if (get_oid(colon + 1, &entry->expect))
+       else if (repo_get_oid(the_repository, colon + 1, &entry->expect))
                return error(_("cannot parse expected object name '%s'"),
                             colon + 1);
        return 0;
@@ -2662,7 +2670,7 @@ static int is_reachable_in_reflog(const char *local, const struct ref *remote)
                if (MERGE_BASES_BATCH_SIZE < size)
                        size = MERGE_BASES_BATCH_SIZE;
 
-               if ((ret = in_merge_bases_many(commit, size, chunk)))
+               if ((ret = repo_in_merge_bases_many(the_repository, commit, size, chunk)))
                        break;
        }