Currently, the check phase errors out if any non-unix line endings are found in a patch file.

      $contents = file_get_contents($file);
      if (strpos($contents, "\r") !== FALSE) {
        $this->set_error(array('@filename' => basename($file)));
        break;
      }

However, we should allow a test to run if the non-unix line endings are being 'removed' via a patch file.

Suggested approach would be to read the file line by line, and if \r found, check for a '-' at the beginning of that line before throwing an error.

Comments

rfay’s picture

Wouldn't a preg_match() do this more elegantly?

jthorson’s picture

Well ... I said 'suggested approach', not 'best suggested approach'. Two days of line-by-line debugging, and now 'line by line' is the first thing to pop into my head. ;)

jthorson’s picture

Status: Active » Needs review
StatusFileSize
new465 bytes

Untested, but should be close. Need to do some research and find some patches to test it.

jthorson’s picture

Tested on scratchtestbot and commited to 6.x-2.x (a0fe4fb).

jthorson’s picture

Status: Needs review » Fixed
jthorson’s picture

Status: Fixed » Needs work
StatusFileSize
new263 bytes

Ooops ... this broke the 'non-unix-line-endings' confirmation patch.

jthorson’s picture

Status: Needs work » Fixed

Committed to 6.x-2.x (commit 000daa5).

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.