mirror of
https://github.com/atom/atom.git
synced 2026-02-05 20:25:04 -05:00
Show ignored icon in status bar
This commit is contained in:
@@ -114,6 +114,9 @@ class StatusBarView extends View
|
||||
else if git.isStatusNew(status)
|
||||
@gitStatusIcon.addClass('new-status-icon')
|
||||
@gitStatusIcon.text("+#{@buffer.getLineCount()}")
|
||||
else if git.isPathIgnored(path)
|
||||
@gitStatusIcon.addClass('ignored-status-icon')
|
||||
@gitStatusIcon.text('')
|
||||
|
||||
updatePathText: ->
|
||||
if path = @editor.getPath()
|
||||
|
||||
@@ -124,12 +124,14 @@ describe "StatusBar", ->
|
||||
expect(statusBar.branchLabel.text()).toBe ''
|
||||
|
||||
describe "git status label", ->
|
||||
[repo, path, originalPathText, newPath] = []
|
||||
[repo, path, originalPathText, newPath, ignoredPath] = []
|
||||
|
||||
beforeEach ->
|
||||
path = require.resolve('fixtures/git/working-dir/file.txt')
|
||||
newPath = fs.join(fs.resolveOnLoadPath('fixtures/git/working-dir'), 'new.txt')
|
||||
fs.write(newPath, "I'm new here")
|
||||
ignoredPath = fs.join(fs.resolveOnLoadPath('fixtures/git/working-dir'), 'ignored.txt')
|
||||
fs.write(ignoredPath, 'ignored.txt')
|
||||
git.getPathStatus(path)
|
||||
git.getPathStatus(newPath)
|
||||
originalPathText = fs.read(path)
|
||||
@@ -138,6 +140,7 @@ describe "StatusBar", ->
|
||||
afterEach ->
|
||||
fs.write(path, originalPathText)
|
||||
fs.remove(newPath) if fs.exists(newPath)
|
||||
fs.remove(ignoredPath) if fs.exists(ignoredPath)
|
||||
|
||||
it "displays the modified icon for a changed file", ->
|
||||
fs.write(path, "i've changed for the worse")
|
||||
@@ -153,6 +156,10 @@ describe "StatusBar", ->
|
||||
rootView.open(newPath)
|
||||
expect(statusBar.gitStatusIcon).toHaveClass('new-status-icon')
|
||||
|
||||
it "displays the ignored icon for an ignored file", ->
|
||||
rootView.open(ignoredPath)
|
||||
expect(statusBar.gitStatusIcon).toHaveClass('ignored-status-icon')
|
||||
|
||||
it "updates when a status-changed event occurs", ->
|
||||
fs.write(path, "i've changed for the worse")
|
||||
git.getPathStatus(path)
|
||||
|
||||
Reference in New Issue
Block a user