mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Remove git-status-changed event from Buffer
This is now fired as a status-changed event from the Git class when the checkout completes normally and the status of the path changes.
This commit is contained in:
@@ -422,8 +422,7 @@ class Buffer
|
||||
checkoutHead: ->
|
||||
path = @getPath()
|
||||
return unless path
|
||||
if git?.checkoutHead(path)
|
||||
@trigger 'git-status-changed'
|
||||
git?.checkoutHead(path)
|
||||
|
||||
scheduleStoppedChangingEvent: ->
|
||||
clearTimeout(@stoppedChangingTimeout) if @stoppedChangingTimeout
|
||||
|
||||
@@ -114,7 +114,9 @@ class Git
|
||||
return head
|
||||
|
||||
checkoutHead: (path) ->
|
||||
@getRepo().checkoutHead(@relativize(path))
|
||||
headCheckedOut = @getRepo().checkoutHead(@relativize(path))
|
||||
@getPathStatus(path) if headCheckedOut
|
||||
headCheckedOut
|
||||
|
||||
getDiffStats: (path) ->
|
||||
@getRepo().getDiffStats(@relativize(path)) ? added: 0, deleted: 0
|
||||
|
||||
@@ -46,7 +46,6 @@ class StatusBarView extends View
|
||||
@buffer?.off '.status-bar'
|
||||
@buffer = @editor.getBuffer()
|
||||
@buffer.on 'contents-modified.status-bar', (e) => @updateBufferHasModifiedText(e.differsFromDisk)
|
||||
@buffer.on 'git-status-changed.status-bar', => @updateStatusBar()
|
||||
@updateStatusBar()
|
||||
|
||||
updateStatusBar: ->
|
||||
|
||||
@@ -153,14 +153,13 @@ describe "StatusBar", ->
|
||||
rootView.open(newPath)
|
||||
expect(statusBar.gitStatusIcon).toHaveClass('new-status-icon')
|
||||
|
||||
it "updates when a git-status-changed event occurs", ->
|
||||
it "updates when a status-changed event occurs", ->
|
||||
fs.write(path, "i've changed for the worse")
|
||||
git.getPathStatus(path)
|
||||
rootView.open(path)
|
||||
expect(statusBar.gitStatusIcon).toHaveClass('modified-status-icon')
|
||||
fs.write(path, originalPathText)
|
||||
git.getPathStatus(path)
|
||||
rootView.getActiveEditor().getBuffer().trigger 'git-status-changed'
|
||||
expect(statusBar.gitStatusIcon).not.toHaveClass('modified-status-icon')
|
||||
|
||||
it "displays the diff stat for modified files", ->
|
||||
|
||||
@@ -13,7 +13,6 @@ class Tab extends View
|
||||
@subscribe @buffer, 'path-changed', => @updateFileName()
|
||||
@subscribe @buffer, 'contents-modified', => @updateModifiedStatus()
|
||||
@subscribe @buffer, 'saved', => @updateModifiedStatus()
|
||||
@subscribe @buffer, 'git-status-changed', => @updateModifiedStatus()
|
||||
@subscribe @editor, 'editor:edit-session-added', => @updateFileName()
|
||||
@subscribe @editor, 'editor:edit-session-removed', => @updateFileName()
|
||||
@updateFileName()
|
||||
|
||||
Reference in New Issue
Block a user