mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-09 18:22:16 +00:00
Use the internal sort in the local transport
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
This commit is contained in:
parent
a655cc3571
commit
8c1d5d4839
@ -14,14 +14,6 @@ typedef struct {
|
||||
git_vector *refs;
|
||||
} transport_local;
|
||||
|
||||
static int cmp_refs(const void *a, const void *b)
|
||||
{
|
||||
const char *stra = *(const char * const *) a;
|
||||
const char *strb = *(const char * const *) b;
|
||||
|
||||
return strcmp(stra, strb);
|
||||
}
|
||||
|
||||
/*
|
||||
* Try to open the url as a git directory. The direction doesn't
|
||||
* matter in this case because we're calulating the heads ourselves.
|
||||
@ -148,7 +140,7 @@ static int local_ls(git_transport *transport, git_headarray *array)
|
||||
return error;
|
||||
|
||||
/* Sort the references first */
|
||||
qsort(refs.strings, refs.count, sizeof(char *), cmp_refs);
|
||||
git__tsort((void **)refs.strings, refs.count, (git_vector_cmp) strcmp);
|
||||
|
||||
/* Add HEAD */
|
||||
error = add_ref(GIT_HEAD_FILE, repo, vec);
|
||||
|
Loading…
Reference in New Issue
Block a user