Skip to content

Commit d2059df

Browse files
committed
Fix the bug mentioned in the previous commit
1 parent 61c56c7 commit d2059df

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

pkg/gui/controllers/commits_files_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,8 @@ func (self *CommitFilesController) openCopyMenu() error {
292292

293293
func (self *CommitFilesController) checkout(node *filetree.CommitFileNode) error {
294294
self.c.LogAction(self.c.Tr.Actions.CheckoutFile)
295-
if err := self.c.Git().WorkingTree.CheckoutFile(self.context().GetRef().RefName(), node.GetPath()); err != nil {
295+
_, to := self.context().GetFromAndToForDiff()
296+
if err := self.c.Git().WorkingTree.CheckoutFile(to, node.GetPath()); err != nil {
296297
return err
297298
}
298299

pkg/integration/tests/commit/checkout_file_from_range_selection_of_commits.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ var CheckoutFileFromRangeSelectionOfCommits = NewIntegrationTest(NewIntegrationT
5151
Equals("M file.txt"),
5252
)
5353

54-
/* EXPECTED:
5554
t.FileSystem().FileContent("file.txt", Equals("three\n"))
56-
ACTUAL: */
57-
t.FileSystem().FileContent("file.txt", Equals("two\n"))
5855
},
5956
})

0 commit comments

Comments
 (0)