Commit a3d30de
Wrap git/hg detectors in try-catch. See #905.
Summary:
In #905 it was reported that people without mercurial had some trouble with `jest -o`. I fixed that initially but on some system it seems like `childProcess.spawn` can throw. It doesn't seem to happen on OS X locally but based on what I read about `childProcess.spawn` I do believe it can throw. I think it is best to wrap it in a try-catch now – the worst thing that can happen is to report back as not a git or not an hg repo, which it won't be if the commands fail.
I also took a note to write an integration test for this, now that we have integration tests. I will add a few in a follow up.
Closes #941
Reviewed By: kentaromiura
Differential Revision: D3229317
fb-gh-sync-id: 34bffb7f256924b9766f6b12ba9c81ac663d8eba
fbshipit-source-id: 34bffb7f256924b9766f6b12ba9c81ac663d8eba1 parent 8ea6115 commit a3d30de
2 files changed
+19
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
| |||
0 commit comments