mirror of
https://github.com/octoleo/restic.git
synced 2024-12-04 02:48:21 +00:00
Merge pull request #703 from sjoerdsimons/master
Avoid duplicate backup paths
This commit is contained in:
commit
3add2f0acb
@ -289,7 +289,7 @@ func readLinesFromFile(filename string) ([]string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func runBackup(opts BackupOptions, gopts GlobalOptions, args []string) error {
|
func runBackup(opts BackupOptions, gopts GlobalOptions, args []string) error {
|
||||||
target, err := readLinesFromFile(opts.FilesFrom)
|
fromfile, err := readLinesFromFile(opts.FilesFrom)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -297,11 +297,12 @@ func runBackup(opts BackupOptions, gopts GlobalOptions, args []string) error {
|
|||||||
// merge files from files-from into normal args so we can reuse the normal
|
// merge files from files-from into normal args so we can reuse the normal
|
||||||
// args checks and have the ability to use both files-from and args at the
|
// args checks and have the ability to use both files-from and args at the
|
||||||
// same time
|
// same time
|
||||||
args = append(args, target...)
|
args = append(args, fromfile...)
|
||||||
if len(args) == 0 {
|
if len(args) == 0 {
|
||||||
return errors.Fatalf("wrong number of parameters")
|
return errors.Fatalf("wrong number of parameters")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
target := make([]string, 0, len(args))
|
||||||
for _, d := range args {
|
for _, d := range args {
|
||||||
if a, err := filepath.Abs(d); err == nil {
|
if a, err := filepath.Abs(d); err == nil {
|
||||||
d = a
|
d = a
|
||||||
|
Loading…
Reference in New Issue
Block a user