diff options
author | Scott J. Goldman <scottjg@github.com> | 2013-01-05 12:46:39 +0400 |
---|---|---|
committer | Scott J. Goldman <scottjg@github.com> | 2013-01-05 12:46:39 +0400 |
commit | ef82ff30f6dd643ca6aac13deac4b11b519128aa (patch) | |
tree | bd1b99a1c8a54d24f471fd9a3fd8eba332d2a76e /src/refs.c | |
parent | 7511d8b42d2ab9e955cd630664ac893e6b35eb63 (diff) |
Handle packed refs with no trailing newlineno-newline-packed-refs
I saw a repo in the wild today which had a master branch ref which was packed, but had no trailing newline. Git handled it fine, but libgit2 choked on it. Fix seems simple enough. If we don't see a newline, assume the end of the buffer is the end of the ref line.
Diffstat (limited to 'src/refs.c')
-rw-r--r-- | src/refs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/refs.c b/src/refs.c index c77e9a56c..70f12b503 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--; |