Changes
4 changed files (+22/-3)
-
-
@@ -27,6 +27,7 @@ buildGoModule {ldflags = [ # git binary from nixpkgs links against libs under "/nix/store/.../lib" "-X main.additionalAccessDirs=/nix/store" "-X github.com/pocka/legit/git/exe.gitPath=${lib.getExe git}" ]; # Test scripts invoke system "git" command.
-
-
git/exe/exe.go (new)
-
@@ -0,0 +1,15 @@// Copyright 2026 Shota FUJI <pockawoooh@gmail.com> // SPDX-License-Identifier: MIT package exe var gitPath string func GitBin() string { if gitPath != "" { return gitPath } // Let the system resolve. return "git" }
-
-
-
@@ -9,6 +9,8 @@ import ("os/exec" "strings" "syscall" "github.com/pocka/legit/git/exe" ) // Mostly from charmbracelet/soft-serve and sosedoff/gitkit.
-
@@ -20,7 +22,7 @@ type ServiceCommand struct {} func (c *ServiceCommand) InfoRefs() error { cmd := exec.Command("git", []string{ cmd := exec.Command(exe.GitBin(), []string{ "upload-pack", "--stateless-rpc", "--advertise-refs",
-
@@ -68,7 +70,7 @@ func (c *ServiceCommand) InfoRefs() error {} func (c *ServiceCommand) UploadPack() error { cmd := exec.Command("git", []string{ cmd := exec.Command(exe.GitBin(), []string{ "-c", "uploadpack.allowFilter=true", "upload-pack", "--stateless-rpc",
-
-
-
@@ -12,6 +12,7 @@ import ("github.com/pocka/legit/config" "github.com/pocka/legit/embed" "github.com/pocka/legit/git/exe" "github.com/pocka/legit/routes" )
-
@@ -73,7 +74,7 @@ func main() {write: true, } if path, err := exec.LookPath("git"); err != nil { if path, err := exec.LookPath(exe.GitBin()); err != nil { log.Printf("Unable to find git binary, git operations will fail: %s", err) } else { fsAllowList = append(fsAllowList, filesystemAccess{
-