aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/repo_archive.go
diff options
context:
space:
mode:
authorTheFox0x7 <thefox0x7@gmail.com>2025-03-04 20:56:11 +0100
committerGitHub <noreply@github.com>2025-03-04 11:56:11 -0800
commitae3a18e01a10520f5e12255304c7a9bbb246c41e (patch)
tree58494c1e9ae3ac68e773efdcfcb98a961d56914a /modules/git/repo_archive.go
parent6c8fb8d455cfe25d5aa966674624bce99fba1735 (diff)
downloadgitea-ae3a18e01a10520f5e12255304c7a9bbb246c41e.tar.gz
gitea-ae3a18e01a10520f5e12255304c7a9bbb246c41e.zip
Remove context from git struct (#33793)
Argument is moved from struct init in command run, which lets us remove context from struct.
Diffstat (limited to 'modules/git/repo_archive.go')
-rw-r--r--modules/git/repo_archive.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/git/repo_archive.go b/modules/git/repo_archive.go
index 92f3e88f7c..0b2f6f2a45 100644
--- a/modules/git/repo_archive.go
+++ b/modules/git/repo_archive.go
@@ -53,7 +53,7 @@ func (repo *Repository) CreateArchive(ctx context.Context, format ArchiveType, t
return fmt.Errorf("unknown format: %v", format)
}
- cmd := NewCommand(ctx, "archive")
+ cmd := NewCommand("archive")
if usePrefix {
cmd.AddOptionFormat("--prefix=%s", filepath.Base(strings.TrimSuffix(repo.Path, ".git"))+"/")
}
@@ -61,7 +61,7 @@ func (repo *Repository) CreateArchive(ctx context.Context, format ArchiveType, t
cmd.AddDynamicArguments(commitID)
var stderr strings.Builder
- err := cmd.Run(&RunOpts{
+ err := cmd.Run(ctx, &RunOpts{
Dir: repo.Path,
Stdout: target,
Stderr: &stderr,