From db1ba2a2302e7942981c70f9356c70e21e3f7bc7 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Tue, 19 Feb 2019 00:04:59 +0000 Subject: 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 Signed-off-by: Junio C Hamano --- submodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'submodule.c') diff --git a/submodule.c b/submodule.c index 21cf50ca15..150d955899 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 --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); -- cgit v1.3