]> git.ipfire.org Git - thirdparty/git.git/commitdiff
remote: pass repository to push tracking helper
authorHarald Nordgren <haraldnordgren@gmail.com>
Wed, 22 Jul 2026 18:08:57 +0000 (18:08 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 22 Jul 2026 18:29:48 +0000 (11:29 -0700)
The next commit needs tracking_for_push_dest() to inspect the
repository's configured remotes. Pass the repository through the
existing callers and mark the new parameter as unused.

No change in behavior.

Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
remote.c

index b17648d6ef32e4f438ff9426571d369421e84886..0dc36956c346c051b5c551e4d02694f8b43a3e9e 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -1887,7 +1887,8 @@ const char *branch_get_upstream(struct branch *branch, struct strbuf *err)
        return branch->merge[0]->dst;
 }
 
-static char *tracking_for_push_dest(struct remote *remote,
+static char *tracking_for_push_dest(struct repository *repo UNUSED,
+                                   struct remote *remote,
                                    const char *refname,
                                    struct strbuf *err)
 {
@@ -1925,13 +1926,13 @@ static char *branch_get_push_1(struct repository *repo,
                                         _("push refspecs for '%s' do not include '%s'"),
                                         remote->name, branch->name);
 
-               ret = tracking_for_push_dest(remote, dst, err);
+               ret = tracking_for_push_dest(repo, remote, dst, err);
                free(dst);
                return ret;
        }
 
        if (remote->mirror)
-               return tracking_for_push_dest(remote, branch->refname, err);
+               return tracking_for_push_dest(repo, remote, branch->refname, err);
 
        switch (push_default) {
        case PUSH_DEFAULT_NOTHING:
@@ -1939,7 +1940,7 @@ static char *branch_get_push_1(struct repository *repo,
 
        case PUSH_DEFAULT_MATCHING:
        case PUSH_DEFAULT_CURRENT:
-               return tracking_for_push_dest(remote, branch->refname, err);
+               return tracking_for_push_dest(repo, remote, branch->refname, err);
 
        case PUSH_DEFAULT_UPSTREAM:
                return xstrdup_or_null(branch_get_upstream(branch, err));
@@ -1953,7 +1954,7 @@ static char *branch_get_push_1(struct repository *repo,
                        up = branch_get_upstream(branch, err);
                        if (!up)
                                return NULL;
-                       cur = tracking_for_push_dest(remote, branch->refname, err);
+                       cur = tracking_for_push_dest(repo, remote, branch->refname, err);
                        if (!cur)
                                return NULL;
                        if (strcmp(cur, up)) {