From efcc87c9d95a0b156c657c0e5c11580e7f071efd Mon Sep 17 00:00:00 2001 From: Romain Geissler Date: Mon, 6 Jun 2011 10:02:07 +0200 Subject: 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. --- src/repository.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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); } -- cgit v1.2.1