File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed
Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,8 @@ def full_log_commits(opts={})
9393 arr_opts += log_path_options ( opts )
9494
9595 full_log = command_lines ( 'log' , arr_opts , true )
96- process_commit_data ( full_log )
96+
97+ process_commit_log_data ( full_log )
9798 end
9899
99100
@@ -129,6 +130,30 @@ def commit_data(sha)
129130 end
130131
131132 def process_commit_data ( data , sha = nil , indent = 4 )
133+ hsh = {
134+ 'sha' => sha ,
135+ 'message' => '' ,
136+ 'parent' => [ ]
137+ }
138+
139+ loop do
140+ key , *value = data . shift . split
141+
142+ break if key . nil?
143+
144+ if key == 'parent'
145+ hsh [ 'parent' ] << value . join ( ' ' )
146+ else
147+ hsh [ key ] = value . join ( ' ' )
148+ end
149+ end
150+
151+ hsh [ 'message' ] = data . collect { |line | line [ indent ..-1 ] } . join ( "\n " ) + "\n "
152+
153+ return hsh
154+ end
155+
156+ def process_commit_log_data ( data , sha = nil , indent = 4 )
132157 in_message = false
133158
134159 if sha
You can’t perform that action at this time.
0 commit comments