|
|
@@ -249,8 +249,8 @@ class GitDataCollector(DataCollector):
|
|
249
|
249
|
|
|
250
|
250
|
self.extensions[ext]['files'] += 1
|
|
251
|
251
|
try:
|
|
252
|
|
- # FIXME filenames with spaces or special characters are broken
|
|
253
|
|
- self.extensions[ext]['lines'] += int(getoutput('wc -l < %s' % line, quiet = True))
|
|
|
252
|
+ # Escaping could probably be improved here
|
|
|
253
|
+ self.extensions[ext]['lines'] += int(getoutput('wc -l < %s' % re.sub(r'(\W)', r'\\\1', line)))
|
|
254
|
254
|
except:
|
|
255
|
255
|
print 'Warning: Could not count lines for file "%s"' % line
|
|
256
|
256
|
|