From bb64cea202f70cda64854f08e54cfcf3957f9fca Mon Sep 17 00:00:00 2001 From: partisan Date: Sun, 8 Dec 2024 15:35:54 +0100 Subject: [PATCH] added skipping //comments in .patches --- apply.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apply.go b/apply.go index 20ca07b..fdde423 100755 --- a/apply.go +++ b/apply.go @@ -87,6 +87,11 @@ func applyPatch(patchPath, rootPath string) error { for scanner.Scan() { line := scanner.Text() + // Ignore lines starting with // + if strings.HasPrefix(strings.TrimSpace(line), "//") { + continue + } + // Detect the target file if strings.HasPrefix(line, "--- ") { relativePath := strings.TrimSpace(strings.TrimPrefix(line, "--- "))