File tree 1 file changed +26
-1
lines changed
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={})
93
93
arr_opts += log_path_options ( opts )
94
94
95
95
full_log = command_lines ( 'log' , arr_opts , true )
96
- process_commit_data ( full_log )
96
+
97
+ process_commit_log_data ( full_log )
97
98
end
98
99
99
100
@@ -129,6 +130,30 @@ def commit_data(sha)
129
130
end
130
131
131
132
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 )
132
157
in_message = false
133
158
134
159
if sha
You can’t perform that action at this time.
0 commit comments