Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure old refs are pruned on fetch #1410

Merged
merged 2 commits into from
Nov 27, 2024
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Unreleased
- Add Ruby 3.3 to CI [#1403](https://github.com/puppetlabs/r10k/pull/1403)
- Require Ruby 3.1 [#1402](https://github.com/puppetlabs/r10k/pull/1402)
- Replace deprecated action: actions/setup-ruby->ruby/setup-ruby [#1406](https://github.com/puppetlabs/r10k/pull/1406)
- Ensure git repositories are pruned on fetch [#1410](https://github.com/puppetlabs/r10k/pull/1410)

4.1.0
-----
Expand Down
2 changes: 1 addition & 1 deletion lib/r10k/git/rugged/working_repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def fetch(remote_name = 'origin')
remote = remotes[remote_name]
proxy = R10K::Git.get_proxy_for_remote(remote)

options = {:credentials => credentials, :proxy_url => proxy}
options = {:credentials => credentials, :proxy_url => proxy, :prune => true}
refspecs = ["+refs/heads/*:refs/remotes/#{remote_name}/*"]

results = nil
Expand Down
2 changes: 1 addition & 1 deletion lib/r10k/git/shellgit/thin_repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def clone(remote, opts = {})

# Fetch refs from the backing bare Git repository.
def fetch(remote = 'cache')
git ['fetch', remote], :path => @path.to_s
git ['fetch', remote, '--prune'], :path => @path.to_s
end

# @return [String] The origin remote URL
Expand Down
Loading