Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/gitserver/server/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func (s *Server) createCommitFromPatch(ctx context.Context, req protocol.CreateC
// NOTE: join messages with a blank line in between ("\n\n")
// because the previous behavior was to use multiple -m arguments,
// which concatenate with a blank line in between.
// Gerrit is the only code host that usees multiple messages at the moment
// Gerrit is the only code host that uses multiple messages at the moment.
cmd.Stdin = strings.NewReader(strings.Join(messages, "\n\n"))

cmd.Dir = tmpRepoDir
Expand Down
2 changes: 0 additions & 2 deletions internal/gitserver/gitdomain/exec.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package gitdomain

import (
"fmt"
"os"
"strconv"
"strings"
Expand Down Expand Up @@ -155,7 +154,6 @@ func IsAllowedGitCmd(logger log.Logger, args []string) bool {
return false
}
if strings.HasPrefix(arg, "-") {
fmt.Printf("EVALUATING ARGUMENT %d: %s\n", i, arg)
// Special-case `git log -S` and `git log -G`, which interpret any characters
// after their 'S' or 'G' as part of the query. There is no long form of this
// flags (such as --something=query), so if we did not special-case these, there
Expand Down
2 changes: 2 additions & 0 deletions internal/gitserver/gitdomain/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ func TestIsAllowedGitCmd(t *testing.T) {
{"reset", "-q", "ceed6a398bd66c090b6c24bd8251ac9255d90fb2"},
{"apply", "--cached", "-p0"},
{"commit", "-m", "An awesome commit message."},
{"commit", "-F", "-"},
{"commit", "--file=-"},
{"push", "--force", "git@github.com:repo/name", "f22cfd066432e382c24f1eaa867444671e23a136:refs/heads/a-branch"},
{"update-ref", "--"},
}
Expand Down