Normalise paths to ensure they are compared properly

This commit is contained in:
comp500 2023-03-24 01:31:10 +00:00
parent 37cc68a9f7
commit fa5460a187

View File

@ -5,6 +5,7 @@ import (
"fmt" "fmt"
"io" "io"
"os" "os"
"path"
"path/filepath" "path/filepath"
"sort" "sort"
"strings" "strings"
@ -261,6 +262,11 @@ func (in *Index) Refresh() error {
), ),
) )
// Normalise file paths: updateFile needs to compare path equality
for i := range in.Files {
in.Files[i].File = path.Clean(in.Files[i].File)
}
for _, v := range fileList { for _, v := range fileList {
start := time.Now() start := time.Now()