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

Don't use "-c" flag in "git:branch-unique()" revision range rule

Summary:
Fixes T9953.

  - "-c" was introduced in 1.7.2.
  - "--no-color" has existed forever as far as I can tell.
  - "--no-column" was introducd in 1.7.11, but there was nothing that needed to be disabled before that (hopefully).

Test Plan:
  - Ran `arc which --trace` and observed a reasonable `git branch` command with correct output.
  - Ran `arc which --trace` with a faked older Git version, observed command omit `--no-column`.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9953

Differential Revision: https://secure.phabricator.com/D14735
This commit is contained in:
epriestley 2015-12-10 14:10:02 -08:00
parent 0c8124a272
commit d0e73bb656

View file

@ -1216,8 +1216,20 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
// Ideally, we would use something like "for-each-ref --contains" // Ideally, we would use something like "for-each-ref --contains"
// to get a filtered list of branches ready for script consumption. // to get a filtered list of branches ready for script consumption.
// Instead, try to get predictable output from "branch --contains". // Instead, try to get predictable output from "branch --contains".
$flags = array();
$flags[] = '--no-color';
// NOTE: The "--no-column" flag was introduced in Git 1.7.11, so
// don't pass it if we're running an older version. See T9953.
$version = $this->getGitVersion();
if (version_compare($version, '1.7.11', '>=')) {
$flags[] = '--no-column';
}
list($branches) = $this->execxLocal( list($branches) = $this->execxLocal(
'-c column.ui=never -c color.ui=never branch --contains %s', 'branch %Ls --contains %s',
$flags,
$commit); $commit);
$branches = array_filter(explode("\n", $branches)); $branches = array_filter(explode("\n", $branches));