mirror of
https://github.com/jkl1337/duplicacy.git
synced 2026-01-02 03:34:39 -06:00
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:
@@ -126,18 +126,20 @@ func (entry *Entry) Copy() *Entry {
|
|||||||
|
|
||||||
func (entry *Entry) HardLinkTo(target *Entry, startChunk int, endChunk int) *Entry {
|
func (entry *Entry) HardLinkTo(target *Entry, startChunk int, endChunk int) *Entry {
|
||||||
endOffset := target.EndOffset
|
endOffset := target.EndOffset
|
||||||
|
link := entry.Link
|
||||||
|
|
||||||
if !target.IsFile() {
|
if !target.IsFile() {
|
||||||
startChunk = target.StartChunk
|
startChunk = target.StartChunk
|
||||||
endChunk = entry.EndChunk
|
endChunk = entry.EndChunk
|
||||||
endOffset = entry.EndOffset
|
endOffset = entry.EndOffset
|
||||||
|
link = target.Link
|
||||||
}
|
}
|
||||||
return &Entry{
|
return &Entry{
|
||||||
Path: entry.Path,
|
Path: entry.Path,
|
||||||
Size: target.Size,
|
Size: target.Size,
|
||||||
Time: target.Time,
|
Time: target.Time,
|
||||||
Mode: target.Mode,
|
Mode: target.Mode,
|
||||||
Link: entry.Link,
|
Link: link,
|
||||||
Hash: target.Hash,
|
Hash: target.Hash,
|
||||||
|
|
||||||
UID: target.UID,
|
UID: target.UID,
|
||||||
|
|||||||
Reference in New Issue
Block a user