Skip to content

Commit

Permalink
Use Git.isPathIgnored even if root path does not match repo root
Browse files Browse the repository at this point in the history
Fixes atom#120
  • Loading branch information
nielsAD committed Aug 25, 2015
1 parent f33760e commit cb2f8d9
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/load-paths-handler.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ class PathLoader
constructor: (@rootPath, ignoreVcsIgnores, @traverseSymlinkDirectories, @ignoredNames) ->
@paths = []
@realPathCache = {}
@repo = null
if ignoreVcsIgnores
repo = GitRepository.open(@rootPath, refreshOnWindowFocus: false)
@repo = repo if repo?.relativize(path.join(@rootPath, 'test')) is 'test'
@repo = if ignoreVcsIgnores then GitRepository.open(@rootPath, refreshOnWindowFocus: false) else null

load: (done) ->
@loadPath @rootPath, =>
Expand All @@ -23,10 +20,10 @@ class PathLoader
done()

isIgnored: (loadedPath) ->
relativePath = path.relative(@rootPath, loadedPath)
if @repo?.isPathIgnored(relativePath)
if @repo?.isPathIgnored(loadedPath)
true
else
relativePath = path.relative(@rootPath, loadedPath)
for ignoredName in @ignoredNames
return true if ignoredName.match(relativePath)

Expand Down

0 comments on commit cb2f8d9

Please sign in to comment.