summaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2019-02-19 00:04:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-04-01 02:57:37 (GMT)
commitdb1ba2a2302e7942981c70f9356c70e21e3f7bc7 (patch)
treea521815bba57e4e5b349e5d19cde22ddec716fca /submodule.c
parent3c7714485dc8adc810b6c52058992cfc767dfcb5 (diff)
downloadgit-db1ba2a2302e7942981c70f9356c70e21e3f7bc7.zip
git-db1ba2a2302e7942981c70f9356c70e21e3f7bc7.tar.gz
git-db1ba2a2302e7942981c70f9356c70e21e3f7bc7.tar.bz2
submodule: avoid hard-coded constants
Instead of using hard-coded 40-based constants, express these values in terms of the_hash_algo and GIT_MAX_HEXSZ. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/submodule.c b/submodule.c
index 21cf50c..150d955 100644
--- a/submodule.c
+++ b/submodule.c
@@ -994,7 +994,7 @@ static int submodule_needs_pushing(struct repository *r,
if (start_command(&cp))
die("Could not run 'git rev-list <commits> --not --remotes -n 1' command in submodule %s",
path);
- if (strbuf_read(&buf, cp.out, 41))
+ if (strbuf_read(&buf, cp.out, the_hash_algo->hexsz + 1))
needs_pushing = 1;
finish_command(&cp);
close(cp.out);