summaryrefslogtreecommitdiff
path: root/src/fetch.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlos@cmartin.tk>2011-08-07 14:02:04 +0200
committerVicent Marti <tanoku@gmail.com>2011-08-18 02:34:09 +0200
commit1564db11fe291eb21b5f57a063deb482cedf323d (patch)
tree2b8657e5a92f8ece775f46753fdf2da3f6e998a2 /src/fetch.c
parentade3c9bb88b0afb4b025cf92c74e17704c9bc4f4 (diff)
downloadlibgit2-1564db11fe291eb21b5f57a063deb482cedf323d.tar.gz
Remove enum git_whn
Instead, use flags inside the git_remote_head structure. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Diffstat (limited to 'src/fetch.c')
-rw-r--r--src/fetch.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/fetch.c b/src/fetch.c
index 7abc196e4..e00b2e31e 100644
--- a/src/fetch.c
+++ b/src/fetch.c
@@ -34,17 +34,6 @@
#include "refspec.h"
#include "fetch.h"
-/*
- * Don't forget that this depends on the enum being correctly set
- */
-static int whn_cmp(const void *a, const void *b)
-{
- git_remote_head *heada = (git_remote_head *) a;
- git_remote_head *headb = (git_remote_head *) b;
-
- return headb->type - heada->type;
-}
-
static int filter_wants(git_remote *remote)
{
git_vector list;
@@ -55,7 +44,7 @@ static int filter_wants(git_remote *remote)
int error;
unsigned int i;
- error = git_vector_init(&list, 16, whn_cmp);
+ error = git_vector_init(&list, 16, NULL);
if (error < GIT_SUCCESS)
return error;
@@ -112,13 +101,12 @@ static int filter_wants(git_remote *remote)
* to the list, storing the local oid for that branch so we
* don't have to look for it again.
*/
- head->type = GIT_WHN_WANT;
+ head->want = 1;
error = git_vector_insert(&list, head);
if (error < GIT_SUCCESS)
goto cleanup;
}
- git_vector_sort(&list);
remote->refs.len = list.length;
remote->refs.heads = (git_remote_head **) list.contents;