summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRomain Geissler <romain.geissler@gmail.com>2011-06-06 10:02:07 +0200
committerRomain Geissler <romain.geissler@gmail.com>2011-06-06 10:02:07 +0200
commitefcc87c9d95a0b156c657c0e5c11580e7f071efd (patch)
tree74cfc0e58dfee729cb08dd1ae9308e23745a4cb9 /src
parent5ec05d0748094b0e7fd1920bd960a24826435cac (diff)
downloadlibgit2-efcc87c9d95a0b156c657c0e5c11580e7f071efd.tar.gz
Repository: A little fix in error code. GIT_ENOTFOUND is returned when a gitfile is malformed and GIT_ENOTAREPO when the pointed dir is not a repo.
Fixed tests so that it check the right error code.
Diffstat (limited to 'src')
-rw-r--r--src/repository.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/repository.c b/src/repository.c
index b721af8b8..2f4a0d3e9 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -412,7 +412,7 @@ static int read_gitfile(char *path_out, size_t size, const char *file_path, cons
for (;data[end_offset] == '\r' || data[end_offset] == '\n'; --end_offset);
data[end_offset + 1] = '\0';
- if (GIT_FILE_CONTENT_PREFIX_LENGTH == end_offset) {
+ if (GIT_FILE_CONTENT_PREFIX_LENGTH == end_offset + 1) {
gitfo_free_buf(&file);
return git__throw(GIT_ENOTFOUND, "No path in git file `%s`", file_path);
}