ugit @main -
refs -
log -
-
https://git.jolheiser.com/ugit.git
Signature
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEgqEQpE3xoo1QwJO/uFOtpdp7v3oFAmXXyNAACgkQuFOtpdp7
v3qtkRAAx7FBWRVRPT/SvaUo834tM0pFD8I7xT52KJMP8ruTqACuMP1vKdJGr1td
+LqZWx5YjQofUVwTzZlscbZUvw2Mg32Z/y52/I2O4FZekYQTsgxv42FVtispHBwl
LjV6jWPjYfbQvWzdlvpAPOhsvNdmU4XBPz7b42PrXAB93s8d0FaqehJfSglAxvkX
ZhMNH2QHz4fUCu29lmpukRw/DyOinENqOK0cxhvfRSnPiUwRvcCFiIkRmUOCwFCh
0lVIeFKNL2JtZOVfFYSFKIg/HZL/ZuK5rkUI9CYC9XTT0oYa23LsEcIMlbJtmiQJ
ECpnveyBeZ6B/tzpp7eu6aGrq80i0eanPk36bwocqFrdtBRM5MpodBEfjZMs0rVp
maXts+AZy8PRs4r6J9ivdPtww8bvOk6ZLZrhfsQ6ywo0FQC/1exxD0ONmhRIvGcE
oo0yYhmXCuHcmqCo0KW2URUG48X9zQD64UJ+U8gO7hg/XZ8YOsUxdC31vMp3eVNF
O6/3/n1XyGDoMwhaEj1BSLrHetOSRd9miVcYloZENYcqvrjX8Z8Z9Tky6OrvU3eb
SfVifnI5+5FsUt/XIA7GQiLnVr7eyKusQRS1+j5fZJCLuW2XUThNXOUu4wnYO10e
jQimxO4LpljaOOIBT0GEY65+cpEUg+5DSkZRzI8mS4nbbGVs1Fw=
=j8q7
-----END PGP SIGNATURE-----
diff --git a/internal/git/protocol_git.go b/internal/git/protocol_git.go
index 7ee650c851b5b3bc68411cb3e3358320fc2b0920..332c8936db1755ab8c64afed597e4f170830aa22 100644
--- a/internal/git/protocol_git.go
+++ b/internal/git/protocol_git.go
@@ -27,7 +27,7 @@ }
if err := pkt.Flush(); err != nil {
return err
}
- return gitService(ctx, "receive-pack", string(c), "--stateless-rpc", "--advertise-refs")
+ return gitService(ctx, "upload-pack", string(c), "--stateless-rpc", "--advertise-refs")
}
func (c CmdProtocol) HTTPUploadPack(ctx ReadWriteContexter) error {
@@ -45,6 +45,7 @@
func gitService(ctx ReadWriteContexter, command, repoDir string, args ...string) error {
cmd := exec.CommandContext(ctx.Context(), "git")
cmd.Args = append(cmd.Args, []string{
+ "-c", "protocol.version=2",
"-c", "uploadpack.allowFilter=true",
"-c", "receive.advertisePushOptions=true",
"-c", fmt.Sprintf("core.hooksPath=%s", filepath.Join(filepath.Dir(repoDir), "hooks")),
@@ -54,8 +56,10 @@ cmd.Args = append(cmd.Args, args...)
}
cmd.Args = append(cmd.Args, repoDir)
import (
+ "os"
cmd.Stdin = ctx
cmd.Stdout = ctx
+ fmt.Println(cmd.Env, cmd.String())
return cmd.Run()
}