]> git.ipfire.org Git - thirdparty/git.git/blobdiff - ls-refs.c
serve: use repository pointer to get config
[thirdparty/git.git] / ls-refs.c
index 48638136556e30577fd3fc85a9e791d729224697..bd9ab2c3482896178a638cb5af9e42ded1e8dc2a 100644 (file)
--- a/ls-refs.c
+++ b/ls-refs.c
@@ -12,11 +12,11 @@ static enum {
        UNBORN_IGNORE = 0,
        UNBORN_ALLOW,
        UNBORN_ADVERTISE /* implies ALLOW */
-} unborn_config(void)
+} unborn_config(struct repository *r)
 {
        const char *str = NULL;
 
-       if (repo_config_get_string_tmp(the_repository, "lsrefs.unborn", &str)) {
+       if (repo_config_get_string_tmp(r, "lsrefs.unborn", &str)) {
                /*
                 * If there is no such config, advertise and allow it by
                 * default.
@@ -168,7 +168,7 @@ int ls_refs(struct repository *r, struct packet_reader *request)
                                strvec_push(&data.prefixes, out);
                }
                else if (!strcmp("unborn", arg))
-                       data.unborn = !!unborn_config();
+                       data.unborn = !!unborn_config(r);
                else
                        die(_("unexpected line: '%s'"), arg);
        }
@@ -199,7 +199,7 @@ int ls_refs(struct repository *r, struct packet_reader *request)
 
 int ls_refs_advertise(struct repository *r, struct strbuf *value)
 {
-       if (value && unborn_config() == UNBORN_ADVERTISE)
+       if (value && unborn_config(r) == UNBORN_ADVERTISE)
                strbuf_addstr(value, "unborn");
 
        return 1;