1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +03:00

feat: add stash option to include untracked changes

This commit is contained in:
Andrew Hynes
2022-06-03 15:41:08 -02:30
committed by Andrew Hynes
parent de6d278e57
commit 7ddb80a13e
3 changed files with 19 additions and 0 deletions

View File

@ -109,3 +109,11 @@ func (self *StashCommands) SaveStagedChanges(message string) error {
return nil
}
func (self *StashCommands) StashUntrackedChanges(message string) error {
if err := self.cmd.New("git stash -u").Run(); err != nil {
return err
}
return nil
}

View File

@ -792,6 +792,13 @@ func (self *FilesController) createStashMenu() error {
},
Key: 'u',
},
{
Label: self.c.Tr.LcStashIncludeUntrackedChanges,
OnPress: func() error {
return self.handleStashSave(self.git.Stash.StashUntrackedChanges, self.c.Tr.Actions.StashIncludeUntrackedChanges, self.c.Tr.NoFilesToStash)
},
Key: 'U',
},
},
})
}

View File

@ -293,6 +293,7 @@ type TranslationSet struct {
LcStashStagedChanges string
LcStashAllChangesKeepIndex string
LcStashUnstagedChanges string
LcStashIncludeUntrackedChanges string
LcStashOptions string
NotARepository string
LcJump string
@ -584,6 +585,7 @@ type Actions struct {
StashAllChangesKeepIndex string
StashStagedChanges string
StashUnstagedChanges string
StashIncludeUntrackedChanges string
GitFlowFinish string
GitFlowStart string
CopyToClipboard string
@ -933,6 +935,7 @@ func EnglishTranslationSet() TranslationSet {
LcStashStagedChanges: "stash staged changes",
LcStashAllChangesKeepIndex: "stash all changes and keep index",
LcStashUnstagedChanges: "stash unstaged changes",
LcStashIncludeUntrackedChanges: "stash all changes including untracked files",
LcStashOptions: "Stash options",
NotARepository: "Error: must be run inside a git repository",
LcJump: "jump to panel",
@ -1207,6 +1210,7 @@ func EnglishTranslationSet() TranslationSet {
StashAllChangesKeepIndex: "Stash all changes and keep index",
StashStagedChanges: "Stash staged changes",
StashUnstagedChanges: "Stash unstaged changes",
StashIncludeUntrackedChanges: "Stash all changes including untracked files",
GitFlowFinish: "Git flow finish",
GitFlowStart: "Git Flow start",
CopyToClipboard: "Copy to clipboard",