diff --git a/changelog/0.8.2/issue-1590 b/changelog/0.8.2/issue-1590 new file mode 100644 index 000000000..47000b435 --- /dev/null +++ b/changelog/0.8.2/issue-1590 @@ -0,0 +1,7 @@ +Bugfix: Strip spaces for lines read via --files-from + +Leading and trailing spaces in lines read via `--files-from` are now stripped, +so it behaves the same as with lines read via `--exclude-file`. + +https://github.com/restic/restic/issues/1590 +https://github.com/restic/restic/pull/1613 diff --git a/cmd/restic/cmd_backup.go b/cmd/restic/cmd_backup.go index 67378e115..4e78a1534 100644 --- a/cmd/restic/cmd_backup.go +++ b/cmd/restic/cmd_backup.go @@ -304,7 +304,7 @@ func readLinesFromFile(filename string) ([]string, error) { scanner := bufio.NewScanner(r) for scanner.Scan() { - line := scanner.Text() + line := strings.TrimSpace(scanner.Text()) // ignore empty lines if line == "" { continue