Skip to content

Commit 3ac4e48

Browse files
author
Aaron Schlesinger
committed
fix(git.go): add the strip remote prefix logic back in
also needs to send info logs to STDOUT so that the strip prefix logic works properly
1 parent 27fd67f commit 3ac4e48

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

pkg/git/git.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,18 @@ import (
2424
//
2525
// .GitHome: the path to Git's home directory.
2626
const preReceiveHookTplStr = `#!/bin/bash
27+
strip_remote_prefix() {
28+
stdbuf -i0 -o0 -e0 sed "s/^/"$'\e[1G'"/"
29+
}
30+
2731
GIT_HOME={{.GitHome}} \
2832
SSH_CONNECTION="$SSH_CONNECTION" \
2933
SSH_ORIGINAL_COMMAND="$SSH_ORIGINAL_COMMAND" \
3034
REPOSITORY="$RECEIVE_REPO" \
3135
USERNAME="$RECEIVE_USER" \
3236
FINGERPRINT="$RECEIVE_FINGERPRINT" \
3337
POD_NAMESPACE="$POD_NAMESPACE" \
34-
boot git-receive
38+
boot git-receive | strip_remote_prefix
3539
`
3640

3741
var preReceiveHookTpl = template.Must(template.New("hooks").Parse(preReceiveHookTplStr))

pkg/log/log.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ func Err(format string, v ...interface{}) {
4040

4141
// Info prints a green-tinted message.
4242
func Info(format string, v ...interface{}) {
43-
fmt.Fprint(Stderr, "---> ")
44-
fmt.Fprintf(Stderr, appendNewLine(format), v...)
43+
fmt.Fprint(Stdout, "---> ")
44+
fmt.Fprintf(Stdout, appendNewLine(format), v...)
4545
}
4646

4747
// Debug prints a cyan-tinted message if IsDebugging is true.

0 commit comments

Comments
 (0)