diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2019-02-19 03:05:26 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-04-01 05:57:39 +0300 |
commit | cfb049119c9e8b8f66a2e1faf1621ac48f714412 (patch) | |
tree | f6926cdd0e31a110b21cd8f4df77f6cb200cbc3e /remote-curl.c | |
parent | bcbb44ba053988fcc0d3ddb876c007898f345992 (diff) |
gitweb: make hash size independent
Gitweb has several hard-coded 40 values throughout it to check for
values that are passed in or acquired from Git. To simplify the code,
introduce a regex variable that matches either exactly 40 or exactly 64
hex characters, and use this variable anywhere we would have previously
hard-coded a 40 in a regex.
Add some helper functions which allow us to write tighter regexes that
match exactly the number of hex characters we're expecting.
Similarly, switch the code that looks for deleted diffinfo information
to look for either 40 or 64 zeros, and update one piece of code to use
this function. Finally, when formatting a log line, allow an
abbreviated describe output to contain up to 64 characters.
Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote-curl.c')
0 files changed, 0 insertions, 0 deletions