Summary:
We assume `git` is available now, but should not. Specifically, if a user runs a working copy operation like `arc list` in an SVN working copy without `git` available, they get this error: P707
We interpret git errors very narrowly; be more liberal in how we interpret them. This assumes users working with `git` will have a functional `git`, but this seems like a reasonable assumption and lets us remove some error text matching code.
Test Plan: Changed `git` to `girt`, ran `arc list`, saw a reasonable exception. Changed back to `git`, saw git detected.
Reviewers: btrahan, vrana
Reviewed By: vrana
CC: svemir, aran
Differential Revision: https://secure.phabricator.com/D4804
return Filesystem::resolvePath(rtrim($stdout, "\n"), $root);
} catch (CommandException $ex) {
- if (preg_match('/^fatal: Not a git repository/', $ex->getStdErr())) {
- return null;
- }
- throw $ex;
+ // This might be because the $root isn't a Git working copy, or the user
+ // might not have Git installed at all so the `git` command fails. Assume
+ // that users trying to work with git working copies will have a working
+ // `git` binary.
+ return null;
}
}