summaryrefslogtreecommitdiff
path: root/src/vector.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vector.c')
-rw-r--r--src/vector.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vector.c b/src/vector.c
index 9f7eed5a3..c769b696a 100644
--- a/src/vector.c
+++ b/src/vector.c
@@ -177,7 +177,8 @@ void git_vector_sort(git_vector *v)
if (git_vector_is_sorted(v) || !v->_cmp)
return;
- git__tsort(v->contents, v->length, v->_cmp);
+ if (v->length > 1)
+ git__tsort(v->contents, v->length, v->_cmp);
git_vector_set_sorted(v, 1);
}