Arc has a spurious failure on arc diff


Observed Behavior:
When we run arc diff, we sometimes run into this error where:
Failed to parse git symbolic-ref output!
(Run with --trace for a full exception trace.)

It happens at line:

I added a print statement. in a diff:

      if (!$branch) {
-        pht('STDOUT FROM SYMBOLIC REF: %s', $stdout);
        throw new Exception(
-          pht('Failed to parse %s output!', 'git symbolic-ref'));
+          pht('Failed to parse %s output [%s]!', 'git symbolic-ref', $stdout));

The output we got:

Failed to parse git symbolic-ref output [refs/heads/0

What Phabricator should be doing.

Phabricator Version:
phabricator 58a1731403eb2e8b6590b2ef7b2cb11be447de55 (Sat, Sep 30) arcanist 822bc53ca306e06314560d8a76f68771d732e8e0 (Feb 24 2017) phutil 796cb1c2ee274397a8a7bc6c10566fd751619d6d (Mar 4 2017)

Reproduction Steps:
spuriously. run enough times:

    arc_cmd = [


Thanks, see