diff options
-rw-r--r-- | sha1_name.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sha1_name.c b/sha1_name.c index 6fca8692d2..e5f7951bfc 100644 --- a/sha1_name.c +++ b/sha1_name.c @@ -835,7 +835,7 @@ static int handle_one_ref(const char *path, } if (object->type != OBJ_COMMIT) return 0; - commit_list_insert_by_date((struct commit *)object, list); + commit_list_insert((struct commit *)object, list); return 0; } @@ -1377,6 +1377,7 @@ static int get_sha1_with_context_1(const char *name, if (!only_to_die && namelen > 2 && name[1] == '/') { struct commit_list *list = NULL; for_each_ref(handle_one_ref, &list); + commit_list_sort_by_date(&list); return get_sha1_oneline(name + 2, sha1, list); } if (namelen < 3 || |