Quellcode durchsuchen

Correct splitting of git-ls-tree output

Split limit 5 was off by one, which resulted in incorrect
processing of file paths with spaces embedded in them.
New split limit of 4 gets the required parts, because it
specifies the allowed number of splits, not elements:

mode type hash size name
    1    2    3    4

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
Diomidis Spinellis vor 11 Jahren
Ursprung
Commit
eb812a450d
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1
    1
      gitstats

+ 1
- 1
gitstats Datei anzeigen

@@ -482,7 +482,7 @@ class GitDataCollector(DataCollector):
482 482
 		for line in lines:
483 483
 			if len(line) == 0:
484 484
 				continue
485
-			parts = re.split('\s+', line, 5)
485
+			parts = re.split('\s+', line, 4)
486 486
 			if parts[0] == '160000' and parts[3] == '-':
487 487
 				# skip submodules
488 488
 				continue