diff options
author | Patrick Steinhardt <ps@pks.im> | 2017-06-06 14:57:31 +0200 |
---|---|---|
committer | Patrick Steinhardt <ps@pks.im> | 2017-06-08 12:05:35 +0200 |
commit | 78a8f68f06b51b064020e5f9c3b564ccf3ad02d9 (patch) | |
tree | bbad168c128618c46da62cba0b4a9b7b36ef649b | |
parent | 9be4c3039a03be75de17ae82d3e72fe44f7aec7d (diff) | |
download | libgit2-78a8f68f06b51b064020e5f9c3b564ccf3ad02d9.tar.gz |
path: only set dotgit flags when configs were read
-rw-r--r-- | src/path.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/path.c b/src/path.c index b7205a646..5fc7a055b 100644 --- a/src/path.c +++ b/src/path.c @@ -1708,6 +1708,7 @@ GIT_INLINE(unsigned int) dotgit_flags( unsigned int flags) { int protectHFS = 0, protectNTFS = 0; + int error = 0; flags |= GIT_PATH_REJECT_DOT_GIT_LITERAL; @@ -1720,13 +1721,13 @@ GIT_INLINE(unsigned int) dotgit_flags( #endif if (repo && !protectHFS) - git_repository__cvar(&protectHFS, repo, GIT_CVAR_PROTECTHFS); - if (protectHFS) + error = git_repository__cvar(&protectHFS, repo, GIT_CVAR_PROTECTHFS); + if (!error && protectHFS) flags |= GIT_PATH_REJECT_DOT_GIT_HFS; if (repo && !protectNTFS) - git_repository__cvar(&protectNTFS, repo, GIT_CVAR_PROTECTNTFS); - if (protectNTFS) + error = git_repository__cvar(&protectNTFS, repo, GIT_CVAR_PROTECTNTFS); + if (!error && protectNTFS) flags |= GIT_PATH_REJECT_DOT_GIT_NTFS; return flags; |