1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-12-23 22:10:54 +01:00

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
This commit is contained in:
Git user 2012-04-11 17:22:07 -07:00 committed by Nick Harper
parent d2915d8c5f
commit 83ad377bdb

View file

@ -140,6 +140,7 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
if (!$default_relative) { if (!$default_relative) {
$default_relative = $this->readScratchFile('default-relative-commit'); $default_relative = $this->readScratchFile('default-relative-commit');
$default_relative = trim($default_relative);
} }
if (!$default_relative) { if (!$default_relative) {