integration test
This commit is contained in:
@@ -254,7 +254,7 @@ func NewGitCloneExecutor(input NewGitCloneExecutorInput) Executor {
|
||||
Force: true,
|
||||
})
|
||||
if err != nil {
|
||||
logger.Errorf("Unable to checkout %s: %v", refName, err)
|
||||
logger.Errorf("Unable to checkout %s: %v", *hash, err)
|
||||
return err
|
||||
}
|
||||
|
||||
|
@@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
// LineHandler is a callback function for handling a line
|
||||
type LineHandler func(line string)
|
||||
type LineHandler func(line string) bool
|
||||
|
||||
type lineWriter struct {
|
||||
buffer bytes.Buffer
|
||||
@@ -42,6 +42,9 @@ func (lw *lineWriter) Write(p []byte) (n int, err error) {
|
||||
|
||||
func (lw *lineWriter) handleLine(line string) {
|
||||
for _, h := range lw.handlers {
|
||||
h(line)
|
||||
ok := h(line)
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -8,8 +8,9 @@ import (
|
||||
|
||||
func TestLineWriter(t *testing.T) {
|
||||
lines := make([]string, 0)
|
||||
lineHandler := func(s string) {
|
||||
lineHandler := func(s string) bool {
|
||||
lines = append(lines, s)
|
||||
return true
|
||||
}
|
||||
|
||||
lineWriter := NewLineWriter(lineHandler)
|
||||
|
Reference in New Issue
Block a user