summaryrefslogtreecommitdiff
path: root/repository.h
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-08-02 15:33:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-08-03 17:54:20 (GMT)
commitf89d085b3f6c4861265baed212c8ff6b7a8ec8e6 (patch)
treeaccab4a6b3ea00de3cc5d64cb090a20d19b511bd /repository.h
parent055e57b7b2183cd5ae7ce8af0becd20623b3db71 (diff)
downloadgit-f89d085b3f6c4861265baed212c8ff6b7a8ec8e6.zip
git-f89d085b3f6c4861265baed212c8ff6b7a8ec8e6.tar.gz
git-f89d085b3f6c4861265baed212c8ff6b7a8ec8e6.tar.bz2
log: refactor "rev.pending" code in cmd_show()
Refactor the juggling of "rev.pending" and our replacement for it amended in the preceding commit so that: * We use an "unsigned int" instead of an "int" for "i", this matches the types of "struct rev_info" itself. * We don't need the "count" and "objects" variables introduced in 5d7eeee2ac6 (git-show: grok blobs, trees and tags, too, 2006-12-14). They were originally added since we'd clobber rev.pending in the loop without restoring it. Since the preceding commit we are restoring it when we handle OBJ_COMMIT, so the main for-loop can refer to "rev.pending" didrectly. * We use the "memcpy a &blank" idiom introduced in 5726a6b4012 (*.c *_init(): define in terms of corresponding *_INIT macro, 2021-07-01). This is more obvious than relying on us enumerating all of the relevant members of the "struct object_array" that we need to clear. * We comment on why we don't need an object_array_clear() here, see the analysis in [1]. 1. https://lore.kernel.org/git/YuQtJ2DxNKX%2Fy70N@coredump.intra.peff.net/ Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'repository.h')
0 files changed, 0 insertions, 0 deletions