Skip to content

Commit

Permalink
fix: only on dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Jun 22, 2024
1 parent e633469 commit 2822ce6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions files/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,9 @@ func addTree(
c.Destination = NormalizeAbsoluteDirPath(destination)
c.FileInfo.Mode = info.Mode() &^ umask
c.FileInfo.MTime = info.ModTime()
if ownedByFilesystem(c.Destination) {
c.Type = TypeImplicitDir
}
case d.Type()&os.ModeSymlink != 0:
linkDestination, err := os.Readlink(path)
if err != nil {
Expand All @@ -510,10 +513,6 @@ func addTree(
c.FileInfo.Mode = tree.FileInfo.Mode
}

if ownedByFilesystem(c.Destination) {
c.Type = TypeImplicitDir
}

all[c.Destination] = c.WithFileInfoDefaults(umask, mtime)

return nil
Expand Down

0 comments on commit 2822ce6

Please sign in to comment.