diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2016-06-18 07:15:19 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-06-20 21:38:21 +0300 |
commit | 2880d16f09635f9d43247b27fd7e6508b992e599 (patch) | |
tree | a26e3e7b2a9cab8e909bb6279cba682f187e09cb /refs/refs-internal.h | |
parent | 0fe5043dad74352c08447eb1913df0b6c3f2731c (diff) |
for_each_reflog(): reimplement using iterators
Allow references with reflogs to be iterated over using a ref_iterator.
The latter is implemented as a files_reflog_iterator, which in turn uses
dir_iterator to read the "logs" directory.
Note that reflog iteration doesn't correctly handle per-worktree
reflogs (either before or after this patch).
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs/refs-internal.h')
-rw-r--r-- | refs/refs-internal.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/refs/refs-internal.h b/refs/refs-internal.h index f73e022f0e..efe584701b 100644 --- a/refs/refs-internal.h +++ b/refs/refs-internal.h @@ -404,6 +404,13 @@ struct ref_iterator *files_ref_iterator_begin(const char *submodule, const char *prefix, unsigned int flags); +/* + * Iterate over the references in the main ref_store that have a + * reflog. The paths within a directory are iterated over in arbitrary + * order. + */ +struct ref_iterator *files_reflog_iterator_begin(void); + /* Internal implementation of reference iteration: */ /* |