Skip to content

Commit fa2fe1f

Browse files
committed
Download specific commit
Signed-off-by: jolheiser <[email protected]>
1 parent 07130e8 commit fa2fe1f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

modules/git/repo.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ func GetDivergingCommits(repoPath string, baseBranch string, targetBranch string
418418
}
419419

420420
// CreateBundle create bundle content to the target path
421-
func (repo *Repository) CreateBundle(ctx context.Context, out io.Writer) error {
421+
func (repo *Repository) CreateBundle(ctx context.Context, commit string, out io.Writer) error {
422422
tmp, err := os.MkdirTemp(os.TempDir(), "gitea-bundle")
423423
if err != nil {
424424
return err
@@ -430,7 +430,7 @@ func (repo *Repository) CreateBundle(ctx context.Context, out io.Writer) error {
430430
"bundle",
431431
"create",
432432
tmpFile,
433-
"--all",
433+
commit,
434434
}
435435
_, err = NewCommandContext(ctx, args...).RunInDir(repo.Path)
436436
if err != nil {

services/archiver/archiver.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ func doArchive(r *ArchiveRequest) (*models.RepoArchiver, error) {
171171
if archiver.Type == git.BUNDLE {
172172
err = gitRepo.CreateBundle(
173173
graceful.GetManager().ShutdownContext(),
174+
archiver.CommitID,
174175
w,
175176
)
176177
} else {

0 commit comments

Comments
 (0)