aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorMax Resnick <max@ofmax.li>2023-02-11 22:23:57 -0800
committerMax Resnick <max@ofmax.li>2023-02-11 22:23:57 -0800
commit9e04be2ca3d8980ebc8ec791d005ba77382fb1fa (patch)
treeee0c9345ad9df46786163e478f0ed68585625a80 /internal
parent754159c40f64478f2656b4fdef2b66c31dfe1211 (diff)
downloadgo-git-server-9e04be2ca3d8980ebc8ec791d005ba77382fb1fa.tar.gz
disable export all, fix path name
Diffstat (limited to 'internal')
-rw-r--r--internal/admin/model.go2
-rw-r--r--internal/admin/model_test.go4
-rw-r--r--internal/git/handler.go2
3 files changed, 3 insertions, 5 deletions
diff --git a/internal/admin/model.go b/internal/admin/model.go
index d9eea03..cf69fcd 100644
--- a/internal/admin/model.go
+++ b/internal/admin/model.go
@@ -137,7 +137,7 @@ func (r *GitRepo) CasbinPolicies() [][]string {
// ReconcileRepo update repo export settings, update web config
func (r *GitRepo) ReconcileRepo(basePath string) {
// if exist -> continue
- repoBase := filepath.Join(basePath, r.Name, ".git")
+ repoBase := filepath.Join(basePath, fmt.Sprintf("%s.git", r.Name))
_, err := os.Stat(repoBase)
if errors.Is(err, fs.ErrNotExist) {
// if no exist -> init bare
diff --git a/internal/admin/model_test.go b/internal/admin/model_test.go
index a4b5874..79e3cb5 100644
--- a/internal/admin/model_test.go
+++ b/internal/admin/model_test.go
@@ -159,7 +159,7 @@ func TestRepoReconcile(t *testing.T) {
"url",
},
}
- repoPath := filepath.Join(tempDir, repo.Name, ".git")
+ repoPath := filepath.Join(tempDir, fmt.Sprintf("%s.git", repo.Name))
repo.ReconcileRepo(tempDir)
if _, err := os.Stat(repoPath); errors.Is(err, fs.ErrNotExist) {
t.Fatal("expected repo to be created, but does not exist")
@@ -181,7 +181,7 @@ bare = true
if !strings.Contains(string(content), "description") {
t.Fatal("expected to find 'description' in config, didn't found", string(content))
}
- gitExportMagicPath := filepath.Join(tempDir, repo.Name, ".git", GitExportMagic)
+ gitExportMagicPath := filepath.Join(tempDir, fmt.Sprintf("%s.git", repo.Name), GitExportMagic)
if _, err := os.Stat(gitExportMagicPath); errors.Is(err, fs.ErrNotExist) {
t.Fatal("expected git export magic to be created, but does not exist")
}
diff --git a/internal/git/handler.go b/internal/git/handler.go
index 6f29483..e90ab5f 100644
--- a/internal/git/handler.go
+++ b/internal/git/handler.go
@@ -18,8 +18,6 @@ func GitHttpBackendHandler(reposDir, backendCommand string) http.Handler {
Dir: ".",
Env: []string{
projectDirEnv,
- // TODO we don't want to export all
- "GIT_HTTP_EXPORT_ALL=1",
fmt.Sprintf("REMOTE_USER=%s", uid),
},
}