Skip to content

Commit

Permalink
tree-cache: don't error out on a childless invalidated entry
Browse files Browse the repository at this point in the history
The code used to assume that there had to be data after the newline in
a tree cache extension entry. This isn't true for a childless
invalidated entry if it's the last one, as there won't be any children
nor a hash to take up space.

Adapt the off-by-one comparison to also work in this case. Fixes #633.
  • Loading branch information
carlosmn authored and arrbee committed Apr 23, 2012
1 parent 7dbbf4d commit 2218fd5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tree-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ static int read_tree_internal(git_tree_cache **out,

tree->children_count = count;

if (*buffer != '\n' || ++buffer >= buffer_end) {
if (*buffer != '\n' || ++buffer > buffer_end) {
error = GIT_EOBJCORRUPTED;
goto cleanup;
}
Expand Down

0 comments on commit 2218fd5

Please sign in to comment.