summaryrefslogtreecommitdiff
path: root/sha1-name.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-07-24 21:50:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-07-24 21:50:49 (GMT)
commit53cae9e0f8d793c7e180f79b86ea2745c59f9bee (patch)
treed3f05ea6ec5784f6788a68076f7b326fa38df768 /sha1-name.c
parent18a86f32ab91a0be390508c0b3cdc374a00822a0 (diff)
parent6b3351e799f733561b98241f6ee88a9a72c13400 (diff)
downloadgit-53cae9e0f8d793c7e180f79b86ea2745c59f9bee.zip
git-53cae9e0f8d793c7e180f79b86ea2745c59f9bee.tar.gz
git-53cae9e0f8d793c7e180f79b86ea2745c59f9bee.tar.bz2
Merge branch 'wc/find-commit-with-pattern-on-detached-head'
"git rev-parse ':/substring'" did not consider the history leading only to HEAD when looking for a commit with the given substring, when the HEAD is detached. This has been fixed. * wc/find-commit-with-pattern-on-detached-head: sha1-name.c: for ":/", find detached HEAD commits
Diffstat (limited to 'sha1-name.c')
-rw-r--r--sha1-name.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sha1-name.c b/sha1-name.c
index 60d9ef3..641ca12 100644
--- a/sha1-name.c
+++ b/sha1-name.c
@@ -1650,6 +1650,7 @@ static int get_oid_with_context_1(const char *name,
struct commit_list *list = NULL;
for_each_ref(handle_one_ref, &list);
+ head_ref(handle_one_ref, &list);
commit_list_sort_by_date(&list);
return get_oid_oneline(name + 2, oid, list);
}