summaryrefslogtreecommitdiff
path: root/pkt-line.h
diff options
context:
space:
mode:
authorLibravatar brian m. carlson <sandals@crustytoothpaste.net>2020-07-29 23:14:18 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-07-30 09:16:48 -0700
commit439d3a17b66d7e2f15fac72960a09261b72ac0d7 (patch)
treeb23f7b05904130463ec89ac1ed458c4520dfecdb /pkt-line.h
parentt0410: mark test with SHA1 prerequisite (diff)
downloadtgif-439d3a17b66d7e2f15fac72960a09261b72ac0d7.tar.xz
http-fetch: set up git directory before parsing pack hashes
In dd4b732df7 ("upload-pack: send part of packfile response as uri", 2020-06-10), the git http-fetch code learned how to take ac --packfile option. This option takes an argument, which is the name of a packfile hash, and parses it using parse_oid_hex. It does so before calling setup_git_directory. However, in a SHA-256 repository this fails to work, since we have not set the hash algorithm in use and parse_oid_hex fails as a consequence. To ensure that we can parse packfile hashes of the right length, let's set up the git directory before we start parsing arguments. Since we still want to allow the invocation of -h to print the help when we're not in a repository, gracefully handle us being outside of one and produce an error after argument parsing has finished. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Reviewed-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pkt-line.h')
0 files changed, 0 insertions, 0 deletions