- t = None
- for line in GRun('diff-index', '-z', *args).raw_output().split('\0'):
- if not line:
- # There's a zero byte at the end of the output, which
- # gives us an empty string as the last "line".
- continue
- if t == None:
- mode_a, mode_b, sha1_a, sha1_b, t = line.split(' ')
- else:
- # the condition is needed in case files is emtpy and
- # diff-index lists those already reported
- if not line in reported_files:
- cache_files.append((t, line))
- reported_files.add(line)
- t = None
+ for t, fn in parse_git_ls(GRun('diff-index', '-z', *args).raw_output()):
+ # the condition is needed in case files is emtpy and
+ # diff-index lists those already reported
+ if not fn in reported_files:
+ cache_files.append((t, fn))
+ reported_files.add(fn)