diff options
Diffstat (limited to 'src/ignore.c')
-rw-r--r-- | src/ignore.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ignore.c b/src/ignore.c index 615cd94bf..ddbcaf3bf 100644 --- a/src/ignore.c +++ b/src/ignore.c @@ -540,6 +540,7 @@ int git_ignore_path_is_ignored( git_ignores ignores; unsigned int i; git_attr_file *file; + git_dir_flag dir_flag = GIT_DIR_FLAG_UNKNOWN; assert(repo && ignored && pathname); @@ -548,7 +549,10 @@ int git_ignore_path_is_ignored( memset(&path, 0, sizeof(path)); memset(&ignores, 0, sizeof(ignores)); - if ((error = git_attr_path__init(&path, pathname, workdir, GIT_DIR_FLAG_UNKNOWN)) < 0 || + if (git_repository_is_bare(repo)) + dir_flag = GIT_DIR_FLAG_FALSE; + + if ((error = git_attr_path__init(&path, pathname, workdir, dir_flag)) < 0 || (error = git_ignore__for_path(repo, path.path, &ignores)) < 0) goto cleanup; |