Fix bug: Only save files when they have changed
This commit is contained in:
@@ -110,7 +110,7 @@ module.exports = class EditableFile extends BaseModel
|
|||||||
return this
|
return this
|
||||||
|
|
||||||
save: (commitMessage)->
|
save: (commitMessage)->
|
||||||
return w(true) if @status is Status.unchanged
|
return w(true) if @status is Status.clean
|
||||||
return w(true) unless @encodedData?
|
return w(true) unless @encodedData?
|
||||||
if not @valid then return w.reject new Error "cannot save with an invalid status: #{@status}"
|
if not @valid then return w.reject new Error "cannot save with an invalid status: #{@status}"
|
||||||
|
|
||||||
@@ -121,7 +121,11 @@ module.exports = class EditableFile extends BaseModel
|
|||||||
|
|
||||||
_updateStatusForNewData: ->
|
_updateStatusForNewData: ->
|
||||||
switch @status
|
switch @status
|
||||||
when Status.unknown then @status = Status.dirty
|
when Status.unknown
|
||||||
when Status.checking then @status = Status.clean
|
@status = Status.dirty
|
||||||
when Status.empty then @status = Status.dirty
|
when Status.checking
|
||||||
when Status.clean then @status = Status.dirty
|
@status = Status.clean
|
||||||
|
when Status.empty
|
||||||
|
@status = Status.dirty
|
||||||
|
when Status.clean
|
||||||
|
@status = Status.dirty
|
||||||
|
|||||||
Reference in New Issue
Block a user