浏览代码

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 11 年前
父节点
当前提交
eb812a450d
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      gitstats

+ 1
- 1
gitstats 查看文件

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