Fix hardlink to symlink naming bug

When creating cloned entries of hardlinked symlinks we have to
preserve the target link data in the entry obviously.
This commit is contained in:
2023-10-06 03:58:38 -05:00
parent 95063913ae
commit bede63f33f

View File

@@ -126,18 +126,20 @@ func (entry *Entry) Copy() *Entry {
func (entry *Entry) HardLinkTo(target *Entry, startChunk int, endChunk int) *Entry {
endOffset := target.EndOffset
link := entry.Link
if !target.IsFile() {
startChunk = target.StartChunk
endChunk = entry.EndChunk
endOffset = entry.EndOffset
link = target.Link
}
return &Entry{
Path: entry.Path,
Size: target.Size,
Time: target.Time,
Mode: target.Mode,
Link: entry.Link,
Link: link,
Hash: target.Hash,
UID: target.UID,