From 83ad377bdb78cc1412bce12687ceac4235bda37b Mon Sep 17 00:00:00 2001 From: Git user Date: Wed, 11 Apr 2012 17:22:07 -0700 Subject: [PATCH] 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 --- src/repository/api/git/ArcanistGitAPI.php | 1 + 1 file changed, 1 insertion(+) 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) {