summaryrefslogtreecommitdiff
path: root/tests-clar/refs/read.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2012-10-15 13:51:25 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2012-10-15 14:00:19 +0200
commit47f44b6ee424921cf5aef064fe6ecf768c6ec5ea (patch)
treebaf5cffab7b8dc1d85679a931b952809692ac818 /tests-clar/refs/read.c
parent9d9288f417968a7fd583786a749c4f7dfa258f89 (diff)
downloadlibgit2-47f44b6ee424921cf5aef064fe6ecf768c6ec5ea.tar.gz
refs: loosen the OID parsing
We used to require loose references to contain only an OID (possibly after trimming the string). This is however not enough for letting us lookup FETCH_HEAD, which can have a lot of content after the initial OID. Change the parsing rules so that a loose refernce must e at least 40 bytes long and the 41st (if it's there) must be accepted by isspace(3). This makes the trim unnecessary, so only do it for symrefs. This fixes #977.
Diffstat (limited to 'tests-clar/refs/read.c')
-rw-r--r--tests-clar/refs/read.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests-clar/refs/read.c b/tests-clar/refs/read.c
index 6ab6bf586..fc2d6b902 100644
--- a/tests-clar/refs/read.c
+++ b/tests-clar/refs/read.c
@@ -212,6 +212,7 @@ void test_refs_read__trailing(void)
cl_git_pass(git_reference_lookup(&test, g_repo, "refs/heads/test"));
cl_git_pass(git_reference_lookup(&trailing, g_repo, "refs/heads/trailing"));
cl_git_pass(git_oid_cmp(git_reference_oid(test), git_reference_oid(trailing)));
+ cl_git_pass(git_reference_lookup(&trailing, g_repo, "FETCH_HEAD"));
git_reference_free(test);
git_reference_free(trailing);