Skip to content

Commit

Permalink
Ensure old refs are pruned on fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
nabertrand committed Nov 22, 2024
1 parent cf6b2fd commit 16f5a67
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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 16f5a67

Please sign in to comment.