MCPcopy Create free account
hub / github.com/apache/arrow / parse_patch

Method parse_patch

dev/release/test-helper.rb:75–95  ·  view source on GitHub ↗
(patch)

Source from the content-addressed store, hash-verified

73 end
74
75 def parse_patch(patch)
76 diffs = []
77 in_hunk = false
78 patch.each_line do |line|
79 case line
80 when /\A--- a\//
81 path = $POSTMATCH.chomp
82 diffs << { path: path, hunks: [] }
83 in_hunk = false
84 when /\A@@/
85 in_hunk = true
86 diffs.last[:hunks] << []
87 when /\A[-+]/
88 next unless in_hunk
89 diffs.last[:hunks].last << line.chomp
90 end
91 end
92 diffs.sort_by do |diff|
93 diff[:path]
94 end
95 end
96end
97
98module VersionDetectable

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected