Commit 2b7b3e1fae889d2bd4a7c8fe538aa636b1eb7ba5

Vicent Martí 2013-01-05T04:30:24

Merge pull request #1193 from libgit2/no-newline-packed-refs Handle packed refs with no trailing newline

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/refs.c b/src/refs.c
index c77e9a5..70f12b5 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -373,7 +373,7 @@ static int packed_parse_oid(
 
 	refname_end = memchr(refname_begin, '\n', buffer_end - refname_begin);
 	if (refname_end == NULL)
-		goto corrupt;
+		refname_end = buffer_end;
 
 	if (refname_end[-1] == '\r')
 		refname_end--;