Fix the bug mentioned in the previous commit

This commit is contained in:
Stefan Haller 2025-03-24 15:29:03 +01:00
parent 61c56c7822
commit d2059df543
2 changed files with 2 additions and 4 deletions

View file

@ -292,7 +292,8 @@ func (self *CommitFilesController) openCopyMenu() error {
func (self *CommitFilesController) checkout(node *filetree.CommitFileNode) error {
self.c.LogAction(self.c.Tr.Actions.CheckoutFile)
if err := self.c.Git().WorkingTree.CheckoutFile(self.context().GetRef().RefName(), node.GetPath()); err != nil {
_, to := self.context().GetFromAndToForDiff()
if err := self.c.Git().WorkingTree.CheckoutFile(to, node.GetPath()); err != nil {
return err
}

View file

@ -51,9 +51,6 @@ var CheckoutFileFromRangeSelectionOfCommits = NewIntegrationTest(NewIntegrationT
Equals("M file.txt"),
)
/* EXPECTED:
t.FileSystem().FileContent("file.txt", Equals("three\n"))
ACTUAL: */
t.FileSystem().FileContent("file.txt", Equals("two\n"))
},
})