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>
This commit is contained in:
committed by
Junio C Hamano
parent
3c7714485d
commit
db1ba2a230
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user