Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-02-23 00:21:54 +0400
committerRussell Belfer <rb@github.com>2013-02-23 00:21:54 +0400
commit37d9168608e9d9a5451011e83623a829eb896dd5 (patch)
tree44f5a4089db9752b1062931c681e7e3848e6e11f /src/attr.c
parent7beeb3f4206b37981e3c42d25a0a638055c068ed (diff)
Do not fail if .gitignore is directory
This is designed to fix libgit2sharp #350 where if .gitignore is a directory we abort all operations that process ignores instead of just skipping it as core git does. Also added test that fails without this change and passes with it.
Diffstat (limited to 'src/attr.c')
-rw-r--r--src/attr.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/attr.c b/src/attr.c
index a1d9932e9..9c88771e3 100644
--- a/src/attr.c
+++ b/src/attr.c
@@ -278,8 +278,14 @@ static int load_attr_file(
return GIT_ENOTFOUND;
error = git_futils_readbuffer(&content, filename);
- if (error < 0)
- return error;
+ if (error < 0) {
+ /* convert error into ENOTFOUND so failed permissions / invalid
+ * file type don't actually stop the operation in progress.
+ */
+ return GIT_ENOTFOUND;
+
+ /* TODO: once warnings are available, issue a warning callback */
+ }
*data = git_buf_detach(&content);