summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2015-03-05 13:13:08 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-03-05 13:13:08 -0800
commitcbc8d6d8f8e858072faa2f8fd03d0f255fe0c288 (patch)
tree348aa7a55aa16299c5935e18bbe69acdc5129f10 /cache.h
parentMerge branch 'tc/curl-vernum-output-broken-in-7.11' into maint (diff)
parentsha1_file: fix iterating loose alternate objects (diff)
downloadtgif-cbc8d6d8f8e858072faa2f8fd03d0f255fe0c288.tar.xz
Merge branch 'jk/prune-mtime' into maint
In v2.2.0, we broke "git prune" that runs in a repository that borrows from an alternate object store. * jk/prune-mtime: sha1_file: fix iterating loose alternate objects for_each_loose_file_in_objdir: take an optional strbuf path
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 04951ddcbf..4d02efc905 100644
--- a/cache.h
+++ b/cache.h
@@ -1254,6 +1254,10 @@ extern int unpack_object_header(struct packed_git *, struct pack_window **, off_
*
* Any callback that is NULL will be ignored. Callbacks returning non-zero
* will end the iteration.
+ *
+ * In the "buf" variant, "path" is a strbuf which will also be used as a
+ * scratch buffer, but restored to its original contents before
+ * the function returns.
*/
typedef int each_loose_object_fn(const unsigned char *sha1,
const char *path,
@@ -1269,6 +1273,11 @@ int for_each_loose_file_in_objdir(const char *path,
each_loose_cruft_fn cruft_cb,
each_loose_subdir_fn subdir_cb,
void *data);
+int for_each_loose_file_in_objdir_buf(struct strbuf *path,
+ each_loose_object_fn obj_cb,
+ each_loose_cruft_fn cruft_cb,
+ each_loose_subdir_fn subdir_cb,
+ void *data);
/*
* Iterate over loose and packed objects in both the local