diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2019-02-19 00:05:26 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-04-01 11:57:39 +0900 |
commit | cfb049119c9e8b8f66a2e1faf1621ac48f714412 (patch) | |
tree | f6926cdd0e31a110b21cd8f4df77f6cb200cbc3e /blame.c | |
parent | Git.pm: make hash size independent (diff) | |
download | tgif-cfb049119c9e8b8f66a2e1faf1621ac48f714412.tar.xz |
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 'blame.c')
0 files changed, 0 insertions, 0 deletions