Skip to content

Commit

Permalink
Merge pull request #1410 from umnmsi/prune
Browse files Browse the repository at this point in the history
Ensure old refs are pruned on fetch
  • Loading branch information
justinstoller authored Nov 27, 2024
2 parents cf6b2fd + 72acc2b commit 552874b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
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

0 comments on commit 552874b

Please sign in to comment.