mirror of
https://github.com/go-gitea/gitea.git
synced 2026-07-22 06:15:18 +02:00
refactor: remove Path field from git.Repository (#38552)
The "path" details should be hidden to other packages By the way, fix a resource leaking in gogit's CommitNodeIndex (the file was not closed in CacheCommit)
This commit is contained in:
@@ -205,6 +205,8 @@ func ToTrustedCmdArgs(args []string) TrustedCmdArgs {
|
||||
}
|
||||
|
||||
type runOpts struct {
|
||||
// TODO: this struct should be removed, the fields can be just merged into the command
|
||||
|
||||
Env []string
|
||||
Timeout time.Duration
|
||||
|
||||
@@ -213,7 +215,7 @@ type runOpts struct {
|
||||
// * /some/path/.git
|
||||
// * /some/path/.git/gitea-data/data/repositories/user/repo.git
|
||||
// If "user/repo.git" is invalid/broken, then running git command in it will use "/some/path/.git", and produce unexpected results
|
||||
// The correct approach is to use `--git-dir" global argument
|
||||
// The correct approach is to use `--git-dir" global argument or "GIT_DIR=..." environment variable.
|
||||
Dir string
|
||||
|
||||
PipelineFunc func(Context) error
|
||||
|
||||
Reference in New Issue
Block a user