mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Use real path to determine if repository root
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
FileView = require './file-view'
|
||||
Directory = require 'directory'
|
||||
$ = require 'jquery'
|
||||
fs = require 'fs'
|
||||
|
||||
module.exports =
|
||||
class DirectoryView extends View
|
||||
@@ -34,7 +35,7 @@ class DirectoryView extends View
|
||||
@updateStatus()
|
||||
@updateStatus()
|
||||
else
|
||||
iconClass = 'repository-icon' if path is git.getWorkingDirectory()
|
||||
iconClass = 'repository-icon' if @isRepositoryRoot()
|
||||
|
||||
@directoryName.addClass(iconClass)
|
||||
|
||||
@@ -53,6 +54,12 @@ class DirectoryView extends View
|
||||
getPath: ->
|
||||
@directory.path
|
||||
|
||||
isRepositoryRoot: ->
|
||||
try
|
||||
git? and git.getWorkingDirectory() is fs.realpathSync(@getPath())
|
||||
catch e
|
||||
false
|
||||
|
||||
isPathIgnored: (path) ->
|
||||
config.get("core.hideGitIgnoredFiles") and git?.isPathIgnored(path)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user