diff options
author | Jeff King <peff@peff.net> | 2014-10-15 18:38:55 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-10-16 10:10:39 -0700 |
commit | 27e1e22d5ee3005f228b67ea94b5af29547b54fe (patch) | |
tree | b6852aec3312ebdffffb968023864782cd0a01e2 /rerere.c | |
parent | 718ccc9731c4e98b123436c22c1cccf2beed5e29 (diff) | |
download | git-27e1e22d5ee3005f228b67ea94b5af29547b54fe.tar.gz git-27e1e22d5ee3005f228b67ea94b5af29547b54fe.tar.xz |
prune: factor out loose-object directory traversal
Prune has to walk $GIT_DIR/objects/?? in order to find the
set of loose objects to prune. Other parts of the code
(e.g., count-objects) want to do the same. Let's factor it
out into a reusable for_each-style function.
Note that this is not quite a straight code movement. The
original code had strange behavior when it found a file of
the form "[0-9a-f]{2}/.{38}" that did _not_ contain all hex
digits. It executed a "break" from the loop, meaning that we
stopped pruning in that directory (but still pruned other
directories!). This was probably a bug; we do not want to
process the file as an object, but we should keep going
otherwise (and that is how the new code handles it).
We are also a little more careful with loose object
directories which fail to open. The original code silently
ignored any failures, but the new code will complain about
any problems besides ENOENT.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'rerere.c')
0 files changed, 0 insertions, 0 deletions