summaryrefslogtreecommitdiff
path: root/src/refdb.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-05-04 16:32:58 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2013-05-11 11:20:38 +0200
commit2b562c3a1edf0f521bdb7adf23e524d5a8389b15 (patch)
treea5ac3a5b361eb21fbcf77fb4c05ce574ab194c65 /src/refdb.c
parent95727245fd4f08aa77d1077901976ab3bd7472e1 (diff)
downloadlibgit2-2b562c3a1edf0f521bdb7adf23e524d5a8389b15.tar.gz
refs: remove the OID/SYMBOLIC filtering
Nobody should ever be using anything other than ALL at this level, so remove the option altogether. As part of this, git_reference_foreach_glob is now implemented in the frontend using an iterator. Backends will later regain the ability of doing the glob filtering in the backend.
Diffstat (limited to 'src/refdb.c')
-rw-r--r--src/refdb.c48
1 files changed, 0 insertions, 48 deletions
diff --git a/src/refdb.c b/src/refdb.c
index 269234bfa..5e33c2e38 100644
--- a/src/refdb.c
+++ b/src/refdb.c
@@ -152,60 +152,12 @@ void git_refdb_iterator_free(git_reference_iterator *iter)
iter->backend->iterator_free(iter);
}
-int git_refdb_foreach(
- git_refdb *db,
- unsigned int list_flags,
- git_reference_foreach_cb callback,
- void *payload)
-{
- assert(db && db->backend);
-
- return db->backend->foreach(db->backend, list_flags, callback, payload);
-}
-
struct glob_cb_data {
const char *glob;
git_reference_foreach_cb callback;
void *payload;
};
-static int fromglob_cb(const char *reference_name, void *payload)
-{
- struct glob_cb_data *data = (struct glob_cb_data *)payload;
-
- if (!p_fnmatch(data->glob, reference_name, 0))
- return data->callback(reference_name, data->payload);
-
- return 0;
-}
-
-int git_refdb_foreach_glob(
- git_refdb *db,
- const char *glob,
- unsigned int list_flags,
- git_reference_foreach_cb callback,
- void *payload)
-{
- int error;
- struct glob_cb_data data;
-
- assert(db && db->backend && glob && callback);
-
- if(db->backend->foreach_glob != NULL)
- error = db->backend->foreach_glob(db->backend,
- glob, list_flags, callback, payload);
- else {
- data.glob = glob;
- data.callback = callback;
- data.payload = payload;
-
- error = db->backend->foreach(db->backend,
- list_flags, fromglob_cb, &data);
- }
-
- return error;
-}
-
int git_refdb_write(git_refdb *db, const git_reference *ref)
{
assert(db && db->backend);