mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-05 00:59:19 +02:00
Merge pull request #2662 from jesseduffield/patches-for-update-args-vector
This commit is contained in:
@ -149,7 +149,7 @@ func (self *WorkingTreeCommands) DiscardAllFileChanges(file *models.File) error
|
||||
|
||||
if file.ShortStatus == "DU" {
|
||||
return self.cmd.New(
|
||||
NewGitCmd("rm").Arg("rm", "--", file.Name).ToArgv(),
|
||||
NewGitCmd("rm").Arg("--", file.Name).ToArgv(),
|
||||
).Run()
|
||||
}
|
||||
|
||||
|
@ -99,9 +99,13 @@ var DiscardChanges = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
{status: "DU", label: "deleted-us.txt", menuTitle: "deleted-us.txt"},
|
||||
})
|
||||
|
||||
t.Common().ContinueOnConflictsResolved()
|
||||
t.ExpectPopup().Confirmation().
|
||||
Title(Equals("continue")).
|
||||
Content(Contains("all merge conflicts resolved. Continue?")).
|
||||
Cancel()
|
||||
|
||||
discardOneByOne([]statusFile{
|
||||
{status: "AM", label: "added-changed.txt", menuTitle: "added-changed.txt"},
|
||||
{status: "MD", label: "change-delete.txt", menuTitle: "change-delete.txt"},
|
||||
{status: "D ", label: "delete-change.txt", menuTitle: "delete-change.txt"},
|
||||
{status: "D ", label: "deleted-staged.txt", menuTitle: "deleted-staged.txt"},
|
||||
@ -109,11 +113,10 @@ var DiscardChanges = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
{status: "MM", label: "double-modded.txt", menuTitle: "double-modded.txt"},
|
||||
{status: "M ", label: "modded-staged.txt", menuTitle: "modded-staged.txt"},
|
||||
{status: " M", label: "modded.txt", menuTitle: "modded.txt"},
|
||||
// the menu title only includes the new file
|
||||
{status: "R ", label: "renamed.txt → renamed2.txt", menuTitle: "renamed2.txt"},
|
||||
{status: "AM", label: "added-changed.txt", menuTitle: "added-changed.txt"},
|
||||
{status: "A ", label: "new-staged.txt", menuTitle: "new-staged.txt"},
|
||||
{status: "??", label: "new.txt", menuTitle: "new.txt"},
|
||||
// the menu title only includes the new file
|
||||
{status: "R ", label: "renamed.txt → renamed2.txt", menuTitle: "renamed2.txt"},
|
||||
})
|
||||
|
||||
t.Views().Files().IsEmpty()
|
||||
|
Reference in New Issue
Block a user