Skip to content

Commit 2120efa

Browse files
authored
[cloud shell] skip comments and empty lines when adding --ignore to mutagen (#391)
1 parent 02074d9 commit 2120efa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

internal/cloud/cloud.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,12 @@ func gitIgnorePaths(configDir string) ([]string, error) {
240240
return nil, errors.WithStack(err)
241241
}
242242

243-
result = append(result, strings.Split(string(contents), "\n")...)
243+
for _, line := range strings.Split(string(contents), "\n") {
244+
line = strings.TrimSpace(line)
245+
if !strings.HasPrefix(line, "#") && line != "" {
246+
result = append(result, line)
247+
}
248+
}
249+
244250
return result, nil
245251
}

0 commit comments

Comments
 (0)