mirror of
https://github.com/restic/restic.git
synced 2025-03-09 00:00:02 +01:00
Fix args for processTargets
This commit is contained in:
parent
d53c3d85ed
commit
a230fffb88
3 changed files with 4 additions and 6 deletions
|
@ -511,7 +511,7 @@ func (arch *Archiver) save(ctx context.Context, snPath, target string, previous
|
|||
return futureNode{}, true, nil
|
||||
}
|
||||
var fi *fs.ExtendedFileInfo
|
||||
fi, shouldReturn, fn, excluded, err := arch.processTargets(target, targetMain, abstarget, *fiMain)
|
||||
fi, shouldReturn, fn, excluded, err := arch.processTargets(target, targetMain, abstarget, fiMain)
|
||||
if shouldReturn {
|
||||
return fn, excluded, err
|
||||
}
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
package archiver
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/restic/restic/internal/fs"
|
||||
"github.com/restic/restic/internal/restic"
|
||||
)
|
||||
|
@ -44,7 +42,7 @@ func getNameFromPathname(pathname string) (name string) {
|
|||
}
|
||||
|
||||
// processTargets is no-op for non-windows OS
|
||||
func (arch *Archiver) processTargets(_ string, _ string, _ string, fiMain os.FileInfo) (fi os.FileInfo, shouldReturn bool, fn futureNode, excluded bool, err error) {
|
||||
func (arch *Archiver) processTargets(_ string, _ string, _ string, fiMain *fs.ExtendedFileInfo) (fi *fs.ExtendedFileInfo, shouldReturn bool, fn futureNode, excluded bool, err error) {
|
||||
return fiMain, false, futureNode{}, false, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ func addADSStreams(pathname string, paths *[]string) {
|
|||
}
|
||||
|
||||
// processTargets in windows performs Lstat for the ADS files since the file info would not be available for them yet.
|
||||
func (arch *Archiver) processTargets(target string, targetMain string, abstarget string, fiMain fs.ExtendedFileInfo) (fi *fs.ExtendedFileInfo, shouldReturn bool, fn futureNode, excluded bool, err error) {
|
||||
func (arch *Archiver) processTargets(target string, targetMain string, abstarget string, fiMain *fs.ExtendedFileInfo) (fi *fs.ExtendedFileInfo, shouldReturn bool, fn futureNode, excluded bool, err error) {
|
||||
if target != targetMain {
|
||||
//If this is an ADS file we need to Lstat again for the file info.
|
||||
fi, err = arch.FS.Lstat(target)
|
||||
|
@ -101,7 +101,7 @@ func (arch *Archiver) processTargets(target string, targetMain string, abstarget
|
|||
return nil, true, futureNode{}, true, nil
|
||||
}
|
||||
} else {
|
||||
fi = &fiMain
|
||||
fi = fiMain
|
||||
}
|
||||
return fi, false, futureNode{}, false, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue