Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ func (r *Repository) ensureFork(ctx context.Context) error {
os.RemoveAll(r.forkRepoPath)
return err
}
// Enable push options support so that pushes from user repos with
// push.pushOption configured (or git versions that send push options
// by default) don't fail with "the receiving end does not support
// push options". See https://github.com/dagger/container-use/issues/323
if _, err := RunGitCommand(ctx, r.forkRepoPath, "config", "receive.advertisePushOptions", "true"); err != nil {
os.RemoveAll(r.forkRepoPath)
return err
}
return nil
})
}
Expand Down
5 changes: 5 additions & 0 deletions repository/repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,10 @@ func TestRepositoryOpen(t *testing.T) {
remote, err := RunGitCommand(ctx, tempDir, "remote", "get-url", "container-use")
require.NoError(t, err)
assert.Equal(t, repo.forkRepoPath, strings.TrimSpace(remote))

// Verify push options are enabled on the fork repo (issue #323)
pushOpts, err := RunGitCommand(ctx, repo.forkRepoPath, "config", "receive.advertisePushOptions")
require.NoError(t, err)
assert.Equal(t, "true", strings.TrimSpace(pushOpts))
})
}