Skip to content

Commit

Permalink
Does not fail even when git status returns an error
Browse files Browse the repository at this point in the history
  • Loading branch information
seachicken committed May 23, 2022
1 parent 88e4f6c commit a401802
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
7 changes: 1 addition & 6 deletions poi.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions poi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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) {
Expand Down

0 comments on commit a401802

Please sign in to comment.