Skip to content

Commit

Permalink
no need for defer since there's only 1 return after cmd.Start()
Browse files Browse the repository at this point in the history
  • Loading branch information
technoweenie committed Apr 7, 2016
1 parent abd9b1e commit 0935817
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ func LocalRefs() ([]*Ref, error) {
return nil, fmt.Errorf("Failed to call git show-ref: %v", err)
}
cmd.Start()
defer cmd.Wait()

var refs []*Ref
scanner := bufio.NewScanner(outp)
Expand All @@ -206,7 +205,7 @@ func LocalRefs() ([]*Ref, error) {
refs = append(refs, &Ref{name, rtype, parts[0]})
}

return refs, nil
return refs, cmd.Wait()
}

// ValidateRemote checks that a named remote is valid for use
Expand Down

0 comments on commit 0935817

Please sign in to comment.