aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/persistent-https
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-12-18 12:35:40 +0900
committerJunio C Hamano <gitster@pobox.com>2025-12-18 20:48:01 +0900
commita650ad996db85b64643970dd7dc5920f989260a0 (patch)
tree0cf71e185acfc18fd110118d0ba352e3cc933786 /contrib/persistent-https
parentMerge branch 'ps/object-read-stream' into jc/object-read-stream-fix (diff)
downloadgit-a650ad996db85b64643970dd7dc5920f989260a0.tar.gz
git-a650ad996db85b64643970dd7dc5920f989260a0.zip
odb: do not use "blank" substitute for NULL
When various *object_info() functions are given an extended object info structure as NULL by a caller that does not want any details, the code uses a file-scope static blank_oi and passes it down to the helper functions they use, to avoid handling NULL specifically. The ps/object-read-stream topic graduated to 'master' recently however had a bug that assumed that two identically named file-scope static variables in two functions are the same, which of course is not the case. This made "git commit" take 0.38 seconds to 1508 seconds in some case, as reported by Aaron Plattner here: https://lore.kernel.org/git/f4ba7e89-4717-4b36-921f-56537131fd69@nvidia.com/ We _could_ move the blank_oi variable to the global scope in common section to fix this regression, but explicitly handling the NULL is a much safer fix. It would also reduce the chance of errors that somebody accidentally writes into blank_oi, making its contents dirty, which potentially will make subsequent calls into the function misbehave. By explicitly handling NULL input, we no longer have to worry about it. Reported-by: Aaron Plattner <aplattner@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/persistent-https')
0 files changed, 0 insertions, 0 deletions