diff options
| author | nulltoken <emeric.fermas@gmail.com> | 2012-06-21 18:48:36 +0200 |
|---|---|---|
| committer | nulltoken <emeric.fermas@gmail.com> | 2012-06-21 18:51:32 +0200 |
| commit | d4827081ea3ed869c92fcc414bea81be7aa3edfe (patch) | |
| tree | 5485a4dfd904afadd58ed918f865fc3d51b6cae5 /src/branch.c | |
| parent | a8fd805e2ff73a3825ddfe6f290774ef5a217972 (diff) | |
| download | libgit2-d4827081ea3ed869c92fcc414bea81be7aa3edfe.tar.gz | |
branch: drop git_branch_list()
Diffstat (limited to 'src/branch.c')
| -rw-r--r-- | src/branch.c | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/branch.c b/src/branch.c index 94d9a955e..671e42051 100644 --- a/src/branch.c +++ b/src/branch.c @@ -141,49 +141,6 @@ on_error: } typedef struct { - git_vector *branchlist; - unsigned int branch_type; -} branch_filter_data; - -static int branch_list_cb(const char *branch_name, void *payload) -{ - branch_filter_data *filter = (branch_filter_data *)payload; - - if (filter->branch_type & GIT_BRANCH_LOCAL && git__prefixcmp(branch_name, GIT_REFS_HEADS_DIR) == 0) { - return git_vector_insert(filter->branchlist, git__strdup(branch_name +strlen(GIT_REFS_HEADS_DIR))); - } else if (filter->branch_type & GIT_BRANCH_REMOTE && git__prefixcmp(branch_name, GIT_REFS_REMOTES_DIR) == 0) { - return git_vector_insert(filter->branchlist, git__strdup(branch_name+strlen(GIT_REFS_DIR))); - } - - return 0; -} - -int git_branch_list(git_strarray *branch_names, git_repository *repo, unsigned int list_flags) -{ - int error; - branch_filter_data filter; - git_vector branchlist; - - assert(branch_names && repo); - - if (git_vector_init(&branchlist, 8, NULL) < 0) - return -1; - - filter.branchlist = &branchlist; - filter.branch_type = list_flags; - - error = git_reference_foreach(repo, GIT_REF_LISTALL, &branch_list_cb, (void *)&filter); - if (error < 0) { - git_vector_free(&branchlist); - return -1; - } - - branch_names->strings = (char **)branchlist.contents; - branch_names->count = branchlist.length; - return 0; -} - -typedef struct { int (*branch_cb)( const char *branch_name, git_branch_t branch_type, |
