Repository: seachicken/gh-poi (go)

Issue:
fails when directory has unreadable files
```
$ gh poi --dry-run
== DRY RUN ==
✕ Fetching pull requests...
failed to run external command: git, args: [status --short]
warning: could not open directory '_many_modules/': Permission denied
```

Where `_many_modules` is a directory I had removed permissions to, i.e. `chmod a-rwx _many_modules`

`git status` returns with exit code `0` in this case, but it does print that `warning` to stderr.

**Your Environment**
- **OS:** Ubuntu 21.10
- **gh:** 2.10.1
- **gh-poi:** v0.5.2


Pull request description:
Does not fail even when `git status` returns an error
Fixes #57 

Patch:
diff --git a/poi.go b/poi.go
index 51cf972..27ff883 100644
--- a/poi.go
+++ b/poi.go
@@ -133,12 +133,7 @@ func GetBranches(conn Connection, dryRun bool) ([]Branch, error) {
 	}
 
 	branches = applyPullRequest(branches, prs, conn)
-
-	uncommittedChanges, err := conn.GetUncommittedChanges()
-	if err != nil {
-		return nil, err
-	}
-
+	uncommittedChanges, _ := conn.GetUncommittedChanges()
 	branches = checkDeletion(branches, uncommittedChanges)
 
 	needsCheckout := false


Test patch:
diff --git a/poi_test.go b/poi_test.go
index 370c718..8f69071 100644
--- a/poi_test.go
+++ b/poi_test.go
@@ -964,7 +964,8 @@ func Test_ReturnsAnErrorWhenGetPullRequestsFails(t *testing.T) {
 	assert.NotNil(t, err)
 }
 
-func Test_ReturnsAnErrorWhenGetUncommittedChangesFails(t *testing.T) {
+// https://github.com/seachicken/gh-poi/issues/57
+func Test_DoesNotReturnsAnErrorWhenGetUncommittedChangesFails(t *testing.T) {
 	ctrl := gomock.NewController(t)
 	defer ctrl.Finish()
 
@@ -991,7 +992,7 @@ func Test_ReturnsAnErrorWhenGetUncommittedChangesFails(t *testing.T) {
 
 	_, err := GetBranches(s.Conn, false)
 
-	assert.NotNil(t, err)
+	assert.Nil(t, err)
 }
 
 func Test_ReturnsAnErrorWhenCheckoutBranchFails(t *testing.T) {