diff options
Diffstat (limited to 'src/pkg/patch/patch.go')
-rw-r--r-- | src/pkg/patch/patch.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pkg/patch/patch.go b/src/pkg/patch/patch.go index 04ecd9d24..9d9aa1b48 100644 --- a/src/pkg/patch/patch.go +++ b/src/pkg/patch/patch.go @@ -207,7 +207,7 @@ func Parse(text []byte) (*Set, os.Error) { p.Diff = diff break } - if hasPrefix(l, "index ") || hasPrefix(l, "GIT binary patch") { + if hasPrefix(l, "GIT binary patch") || (hasPrefix(l, "index ") && !hasPrefix(raw, "--- ")) { diff, err := ParseGitBinary(oldraw) if err != nil { return nil, err @@ -215,6 +215,9 @@ func Parse(text []byte) (*Set, os.Error) { p.Diff = diff break } + if hasPrefix(l, "index ") { + continue + } return nil, SyntaxError("unexpected patch header line: " + string(l)) } if p.Diff == nil { |