diff options
author | Runxi Yu <me@runxiyu.org> | 2025-04-05 11:19:17 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-04-05 11:19:25 +0800 |
commit | cde5824d3ddc0cec9c3a37f146b7075c3d4ffdd7 (patch) | |
tree | abc33d625866a6ba007d9e67e02bd3633b6f7377 /http_handle_repo_index.go | |
parent | git2d: Note to pass integer instead of the string (diff) | |
download | forge-cde5824d3ddc0cec9c3a37f146b7075c3d4ffdd7.tar.gz forge-cde5824d3ddc0cec9c3a37f146b7075c3d4ffdd7.tar.zst forge-cde5824d3ddc0cec9c3a37f146b7075c3d4ffdd7.zip |
git2d: Accept an uint command
Diffstat (limited to 'http_handle_repo_index.go')
-rw-r--r-- | http_handle_repo_index.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/http_handle_repo_index.go b/http_handle_repo_index.go index 164fd65..36e71d7 100644 --- a/http_handle_repo_index.go +++ b/http_handle_repo_index.go @@ -43,12 +43,18 @@ func httpHandleRepoIndex(w http.ResponseWriter, req *http.Request, params map[st defer conn.Close() writer := bare.NewWriter(conn) + reader := bare.NewReader(conn) + if err := writer.WriteData([]byte(repoPath)); err != nil { errorPage500(w, params, "sending repo path failed: "+err.Error()) return } - reader := bare.NewReader(conn) + if err := writer.WriteUint(1); err != nil { + errorPage500(w, params, "sending command failed: "+err.Error()) + return + } + status, err := reader.ReadUint() if err != nil { errorPage500(w, params, "reading status failed: "+err.Error()) |