Skip to content
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Intellij idea
.idea/*
*.iml

# Binaries for programs and plugins
*.exe
Expand Down
3 changes: 3 additions & 0 deletions githttpxfer/githttpxfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ func (ghx *GitHTTPXfer) serviceRPC(ctx Context, rpc string) {
RenderInternalServerError(res.Writer)
return
}
// "git-upload-pack" waits for the remaining input and it hangs,
// so must close it after completing the copy request body to standard input.
stdin.Close()

res.SetContentType(fmt.Sprintf("application/x-git-%s-result", rpc))
res.WriteHeader(http.StatusOK)
Expand Down
7 changes: 7 additions & 0 deletions githttpxfer/githttpxfer_end_to_end_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ func Test_End_To_End_it_should_succeed_clone_and_push_and_fetch_and_log(t *testi

destDirNameA := "test_a"
destDirNameB := "test_b"
destDirNameC := "test_c"
destDirPathA := path.Join(endToEndTestParams.workingDirPath, destDirNameA)
destDirPathB := path.Join(endToEndTestParams.workingDirPath, destDirNameB)
destDirPathC := path.Join(endToEndTestParams.workingDirPath, destDirNameC)

if _, err := execCmd("", "git", "clone", remoteRepoUrl, destDirPathA); err != nil {
t.Errorf("execute command error: %s", err.Error())
Expand Down Expand Up @@ -148,6 +150,11 @@ func Test_End_To_End_it_should_succeed_clone_and_push_and_fetch_and_log(t *testi
return
}

if _, err := execCmd("", "git", "clone", "--depth=1", remoteRepoUrl, destDirPathC); err != nil {
t.Errorf("execute command error: %s", err.Error())
return
}

}

func Test_End_To_End_it_should_succeed_request_to_get_info_refs(t *testing.T) {
Expand Down