Commit 11634346 by nulltoken

revwalk: make git_revwalk_(push|hide)_glob() leverage git_reference_foreach_glob()

parent 527ed554
...@@ -540,7 +540,6 @@ static int push_ref(git_revwalk *walk, const char *refname, int hide) ...@@ -540,7 +540,6 @@ static int push_ref(git_revwalk *walk, const char *refname, int hide)
struct push_cb_data { struct push_cb_data {
git_revwalk *walk; git_revwalk *walk;
const char *glob;
int hide; int hide;
}; };
...@@ -548,10 +547,7 @@ static int push_glob_cb(const char *refname, void *data_) ...@@ -548,10 +547,7 @@ static int push_glob_cb(const char *refname, void *data_)
{ {
struct push_cb_data *data = (struct push_cb_data *)data_; struct push_cb_data *data = (struct push_cb_data *)data_;
if (!p_fnmatch(data->glob, refname, 0)) return push_ref(data->walk, refname, data->hide);
return push_ref(data->walk, refname, data->hide);
return 0;
} }
static int push_glob(git_revwalk *walk, const char *glob, int hide) static int push_glob(git_revwalk *walk, const char *glob, int hide)
...@@ -584,11 +580,10 @@ static int push_glob(git_revwalk *walk, const char *glob, int hide) ...@@ -584,11 +580,10 @@ static int push_glob(git_revwalk *walk, const char *glob, int hide)
goto on_error; goto on_error;
data.walk = walk; data.walk = walk;
data.glob = git_buf_cstr(&buf);
data.hide = hide; data.hide = hide;
if (git_reference_foreach( if (git_reference_foreach_glob(
walk->repo, GIT_REF_LISTALL, push_glob_cb, &data) < 0) walk->repo, git_buf_cstr(&buf), GIT_REF_LISTALL, push_glob_cb, &data) < 0)
goto on_error; goto on_error;
regfree(&preg); regfree(&preg);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment