mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-06 22:33:07 +02:00
Stage only tracked files when staging all in filter-by-tracked-files view
Also, fix two other commands that stage all files under the hood: - when continuing a rebase after resolving conflicts, we auto-stage all files, but in this case we never want to include untracked files, regardless of the filter - likewise, pressing ctrl-f to find a base commit for fixup stages all files for convenience, but again, this should only stage files that are already tracked
This commit is contained in:
@ -634,7 +634,8 @@ func (self *FilesController) toggleStagedAllWithLock() error {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := self.c.Git().WorkingTree.StageAll(); err != nil {
|
||||
onlyTrackedFiles := self.context().GetFilter() == filetree.DisplayTracked
|
||||
if err := self.c.Git().WorkingTree.StageAll(onlyTrackedFiles); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
|
@ -133,7 +133,7 @@ func (self *FixupHelper) HandleFindBaseCommitForFixupPress() error {
|
||||
Prompt: self.c.Tr.HunksWithOnlyAddedLinesWarning,
|
||||
HandleConfirm: func() error {
|
||||
if !hasStagedChanges {
|
||||
if err := self.c.Git().WorkingTree.StageAll(); err != nil {
|
||||
if err := self.c.Git().WorkingTree.StageAll(true); err != nil {
|
||||
return err
|
||||
}
|
||||
self.c.Refresh(types.RefreshOptions{Mode: types.SYNC, Scope: []types.RefreshableView{types.FILES}})
|
||||
|
@ -244,7 +244,7 @@ func (self *MergeAndRebaseHelper) PromptToContinueRebase() error {
|
||||
Prompt: self.c.Tr.UnstagedFilesAfterConflictsResolved,
|
||||
HandleConfirm: func() error {
|
||||
self.c.LogAction(self.c.Tr.Actions.StageAllFiles)
|
||||
if err := self.c.Git().WorkingTree.StageAll(); err != nil {
|
||||
if err := self.c.Git().WorkingTree.StageAll(true); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -207,7 +207,7 @@ func (self *WorkingTreeHelper) promptToStageAllAndRetry(retry func() error) erro
|
||||
Prompt: self.c.Tr.NoFilesStagedPrompt,
|
||||
HandleConfirm: func() error {
|
||||
self.c.LogAction(self.c.Tr.Actions.StageAllFiles)
|
||||
if err := self.c.Git().WorkingTree.StageAll(); err != nil {
|
||||
if err := self.c.Git().WorkingTree.StageAll(false); err != nil {
|
||||
return err
|
||||
}
|
||||
self.syncRefresh()
|
||||
@ -228,7 +228,7 @@ func (self *WorkingTreeHelper) prepareFilesForCommit() error {
|
||||
noStagedFiles := !self.AnyStagedFiles()
|
||||
if noStagedFiles && self.c.UserConfig().Gui.SkipNoStagedFilesWarning {
|
||||
self.c.LogAction(self.c.Tr.Actions.StageAllFiles)
|
||||
err := self.c.Git().WorkingTree.StageAll()
|
||||
err := self.c.Git().WorkingTree.StageAll(false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user