Closed Bug 1602533 Opened 4 years ago Closed 4 years ago

moz-phab chokes on empty files in commit

Categories

(Conduit :: moz-phab, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ytausky, Assigned: zalun)

Details

(Keywords: conduit-triaged)

Attachments

(1 file)

When trying to submit a commit with an empty file I got the following error:

ERROR    2019-12-09 19:08:15,061 Traceback (most recent call last):
  File "/usr/local/bin/moz-phab", line 5084, in main
    args.func(repo, args)
  File "/usr/local/bin/moz-phab", line 4247, in submit
    diff = repo.get_diff(commit)
  File "/usr/local/bin/moz-phab", line 3413, in get_diff
    self._parse_diff_change(raw_change, diff)
  File "/usr/local/bin/moz-phab", line 3321, in _parse_diff_change
    if not lines[-1].endswith("\n"):
IndexError: list index out of range

Adding a \n to the file solved the problem.

Confirmed

Keywords: conduit-triaged
Priority: -- → P1
Assignee: nobody → pzalewa
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: