mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-19 00:28:03 +02:00
reset patch builder when we've escaped from the building phase and nothing has been added
This commit is contained in:
@ -214,6 +214,16 @@ func (p *PatchManager) Reset() {
|
||||
p.fileInfoMap = map[string]*fileInfo{}
|
||||
}
|
||||
|
||||
func (p *PatchManager) IsEmpty() bool {
|
||||
return p != nil && (p.CommitSha == "" || len(p.fileInfoMap) == 0)
|
||||
func (p *PatchManager) CommitSelected() bool {
|
||||
return p.CommitSha != ""
|
||||
}
|
||||
|
||||
func (p *PatchManager) IsEmpty() bool {
|
||||
for _, fileInfo := range p.fileInfoMap {
|
||||
if fileInfo.mode == WHOLE || (fileInfo.mode == PART && len(fileInfo.includedLineIndices) > 0) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
Reference in New Issue
Block a user