From: Git user Date: Thu, 12 Apr 2012 00:22:07 +0000 (-0700) Subject: Read default relative commit from scratch file with newline X-Git-Tag: conduit-4~47 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=83ad377bdb78cc1412bce12687ceac4235bda37b;p=arcanist.git Read default relative commit from scratch file with newline Summary: When people create the .arc/default-relative-commit scratchfile with $EDITOR of choice, their editor usually puts a newline at the end, which breaks arc diff. We should trim the newline before using the contents of the scratchfile. Test Plan: ran arc diff in a working copy that contained a .arc/default-relative-commit with a newline Reviewers: epriestley, jungejason Reviewed By: epriestley CC: aran Differential Revision: https://secure.phabricator.com/D2209 --- diff --git a/src/repository/api/git/ArcanistGitAPI.php b/src/repository/api/git/ArcanistGitAPI.php index bd2163f1..1900e662 100644 --- a/src/repository/api/git/ArcanistGitAPI.php +++ b/src/repository/api/git/ArcanistGitAPI.php @@ -140,6 +140,7 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI { if (!$default_relative) { $default_relative = $this->readScratchFile('default-relative-commit'); + $default_relative = trim($default_relative); } if (!$default_relative) {