mirror of
https://github.com/atom/atom.git
synced 2026-02-16 09:35:54 -05:00
Move checkoutHeadRevision to Workspace.
This commit is contained in:
@@ -1085,3 +1085,22 @@ class Workspace extends Model
|
||||
|
||||
inProcessFinished = true
|
||||
checkFinished()
|
||||
|
||||
checkoutHeadRevision: (editor) ->
|
||||
if editor.getPath()
|
||||
checkoutHead = =>
|
||||
@project.repositoryForDirectory(new Directory(editor.getDirectoryPath()))
|
||||
.then (repository) =>
|
||||
repository?.async.checkoutHeadForEditor(editor)
|
||||
|
||||
if @config.get('editor.confirmCheckoutHeadRevision')
|
||||
@applicationDelegate.confirm
|
||||
message: 'Confirm Checkout HEAD Revision'
|
||||
detailedMessage: "Are you sure you want to discard all changes to \"#{editor.getFileName()}\" since the last Git commit?"
|
||||
buttons:
|
||||
OK: checkoutHead
|
||||
Cancel: null
|
||||
else
|
||||
checkoutHead()
|
||||
else
|
||||
Promise.resolve(false)
|
||||
|
||||
Reference in New Issue
Block a user