1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 14:52:40 +01:00

Ignore detached git branches.

Summary:
Fixes T4559.

It looks like the code currently (at least partially) handles this by checking for `(no branch)`. I suspect that the behaviour of `git` has changed (I am running version 1.9.0) because I haven't figured out what state to be in to cause `git` to output `(no branch)`.

Test Plan: Ran `arc branch` when on a detached branch.

Reviewers: #blessed_reviewers, epriestley

CC: Korvin, epriestley, aran

Maniphest Tasks: T4559

Differential Revision: https://secure.phabricator.com/D8466
This commit is contained in:
Joshua Spence 2014-03-09 08:04:33 -07:00 committed by epriestley
parent a90a72c648
commit a2706f6539

View file

@ -764,7 +764,7 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
$result = array();
foreach ($lines as $line) {
if (preg_match('/^[* ]+\(no branch\)/', $line)) {
if (preg_match('@^[* ]+\(no branch|detached from \w+/\w+\)@', $line)) {
// This is indicating that the working copy is in a detached state;
// just ignore it.
continue;