Skip to content

Commit 53090b2

Browse files
committed
Use GetPath accessor outside of filetree package
In preparation of making it private to the package.
1 parent 2dfc349 commit 53090b2

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

pkg/gui/controllers/commits_files_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ func (self *CommitFilesController) openCopyMenu() error {
231231
copyPathItem := &types.MenuItem{
232232
Label: self.c.Tr.CopyFilePath,
233233
OnPress: func() error {
234-
if err := self.c.OS().CopyToClipboard(node.Path); err != nil {
234+
if err := self.c.OS().CopyToClipboard(node.GetPath()); err != nil {
235235
return err
236236
}
237237
self.c.Toast(self.c.Tr.FilePathCopiedToast)

pkg/gui/controllers/files_controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ func (self *FilesController) pressWithLock(selectedNodes []*filetree.FileNode) e
410410

411411
toPaths := func(nodes []*filetree.FileNode) []string {
412412
return lo.Map(nodes, func(node *filetree.FileNode, _ int) string {
413-
return node.Path
413+
return node.GetPath()
414414
})
415415
}
416416

@@ -881,7 +881,7 @@ func (self *FilesController) openDiffTool(node *filetree.FileNode) error {
881881
return self.c.RunSubprocessAndRefresh(
882882
self.c.Git().Diff.OpenDiffToolCmdObj(
883883
git_commands.DiffToolCmdOptions{
884-
Filepath: node.Path,
884+
Filepath: node.GetPath(),
885885
FromCommit: fromCommit,
886886
ToCommit: "",
887887
Reverse: reverse,
@@ -979,7 +979,7 @@ func (self *FilesController) openCopyMenu() error {
979979
copyPathItem := &types.MenuItem{
980980
Label: self.c.Tr.CopyFilePath,
981981
OnPress: func() error {
982-
if err := self.c.OS().CopyToClipboard(node.Path); err != nil {
982+
if err := self.c.OS().CopyToClipboard(node.GetPath()); err != nil {
983983
return err
984984
}
985985
self.c.Toast(self.c.Tr.FilePathCopiedToast)

pkg/gui/presentation/files.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ func getColorForChangeStatus(changeStatus string) style.TextStyle {
293293
}
294294

295295
func fileNameAtDepth(node *filetree.Node[models.File], depth int) string {
296-
splitName := split(node.Path)
296+
splitName := split(node.GetPath())
297297
name := join(splitName[depth:])
298298

299299
if node.File != nil && node.File.IsRename() {
@@ -314,7 +314,7 @@ func fileNameAtDepth(node *filetree.Node[models.File], depth int) string {
314314
}
315315

316316
func commitFileNameAtDepth(node *filetree.Node[models.CommitFile], depth int) string {
317-
splitName := split(node.Path)
317+
splitName := split(node.GetPath())
318318
name := join(splitName[depth:])
319319

320320
return name

0 commit comments

Comments
 (0)