Code

test-lib: fix TERM to dumb for test repeatability
[git.git] / receive-pack.c
index d0a563df6457a6fc5b40b3502582a78fafdadd53..c90ec7dde28ec135f0c90e6c731b730ad4a1f7a8 100644 (file)
@@ -165,7 +165,8 @@ static const char *update(struct command *cmd)
        unsigned char *new_sha1 = cmd->new_sha1;
        struct ref_lock *lock;
 
-       if (!prefixcmp(name, "refs/") && check_ref_format(name + 5)) {
+       /* only refs/... are allowed */
+       if (prefixcmp(name, "refs/") || check_ref_format(name + 5)) {
                error("refusing to create funny ref '%s' remotely", name);
                return "funny refname";
        }
@@ -468,6 +469,8 @@ int main(int argc, char **argv)
        if (!dir)
                usage(receive_pack_usage);
 
+       setup_path(NULL);
+
        if (!enter_repo(dir, 0))
                die("'%s': unable to chdir or not a git archive", dir);