X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=http-fetch.c;h=a32ac118d90ca6141a72d31f47497116870f6803;hb=HEAD;hp=fffda592670e667e81eb92af218f9a4d95d7614d;hpb=a7ea468346b55b9e817f52c860fb919f5ad7b1af;p=thirdparty%2Fgit.git diff --git a/http-fetch.c b/http-fetch.c index fffda59267..d460bb1837 100644 --- a/http-fetch.c +++ b/http-fetch.c @@ -1,12 +1,14 @@ +#define USE_THE_REPOSITORY_VARIABLE + #include "git-compat-util.h" #include "config.h" -#include "exec-cmd.h" #include "gettext.h" #include "hex.h" #include "http.h" #include "walker.h" #include "setup.h" #include "strvec.h" +#include "url.h" #include "urlmatch.h" #include "trace2.h" @@ -127,8 +129,12 @@ int cmd_main(int argc, const char **argv) } else if (skip_prefix(argv[arg], "--packfile=", &p)) { const char *end; + if (nongit) + die(_("not a git repository")); + packfile = 1; - if (parse_oid_hex(p, &packfile_hash, &end) || *end) + if (parse_oid_hex_algop(p, &packfile_hash, &end, + the_repository->hash_algo) || *end) die(_("argument to --packfile must be a valid hash (got '%s')"), p); } else if (skip_prefix(argv[arg], "--index-pack-arg=", &p)) { strvec_push(&index_pack_args, p);