File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -207,6 +207,24 @@ def blob_at(revision, path)
207
207
( blob . type == :blob ) ? blob : nil
208
208
end
209
209
210
+ # Get log at path for specified object
211
+ #
212
+ # obj - Object in question
213
+ # path - The String file path.
214
+ #
215
+ # Returns an Array of Rugged::Commit objects
216
+ def log_at ( obj , path )
217
+ walker = Rugged ::Walker . new ( self )
218
+ walker . sorting ( Rugged ::SORT_DATE )
219
+ walker . push ( obj )
220
+ en = Enumerator . new do |y |
221
+ walker . each do |commit |
222
+ y << commit if commit . diff ( paths : [ path ] ) . size > 0
223
+ end
224
+ end
225
+ return en
226
+ end
227
+
210
228
def fetch ( remote_or_url , *args )
211
229
unless remote_or_url . kind_of? Remote
212
230
remote_or_url = remotes [ remote_or_url ] || remotes . create_anonymous ( remote_or_url )
You can’t perform that action at this time.
0 commit comments