diff options
author | Carlos Martín Nieto <cmn@elego.de> | 2012-06-05 14:48:51 +0200 |
---|---|---|
committer | Carlos Martín Nieto <carlos@cmartin.tk> | 2012-07-03 12:50:51 +0200 |
commit | 521aedad307c6f72d6f6d660943508b2b015f6dd (patch) | |
tree | aef33032b13ca170a3d7a016e7e8522a7635ce6f /src/odb.c | |
parent | e560aa8ffa7cf143fbd34a5aec44741ae4c77271 (diff) | |
download | libgit2-521aedad307c6f72d6f6d660943508b2b015f6dd.tar.gz |
odb: add git_odb_foreach()
Go through each backend and list every objects that exists in
them. This allows fsck-like uses.
Diffstat (limited to 'src/odb.c')
-rw-r--r-- | src/odb.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -605,6 +605,18 @@ int git_odb_read_prefix( return 0; } +int git_odb_foreach(git_odb *db, int (*cb)(git_oid *oid, void *data), void *data) +{ + unsigned int i; + backend_internal *internal; + git_vector_foreach(&db->backends, i, internal) { + git_odb_backend *b = internal->backend; + b->foreach(b, cb, data); + } + + return 0; +} + int git_odb_write( git_oid *oid, git_odb *db, const void *data, size_t len, git_otype type) { |