Skip to content

Commit 122ad0e

Browse files
wronglinkkoppen
authored andcommitted
Prune repo for deleted branches cleanup
1 parent 6b5ff7c commit 122ad0e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/services/github_hook/updater.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def time_diff_milli(start, finish)
136136
def update_repository(repository)
137137
command = git_command('fetch origin')
138138
if exec(command, repository.url)
139-
command = git_command("fetch origin \"+refs/heads/*:refs/heads/*\"")
139+
command = git_command("fetch --prune origin \"+refs/heads/*:refs/heads/*\"")
140140
exec(command, repository.url)
141141
end
142142
end

test/unit/github_hook/updater_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def test_fetches_changes_from_origin
6161

6262
def test_resets_repository_when_fetch_origin_succeeds
6363
updater.expects(:exec).with("git fetch origin", repository.url).returns(true)
64-
updater.expects(:exec).with("git fetch origin \"+refs/heads/*:refs/heads/*\"", repository.url)
64+
updater.expects(:exec).with("git fetch --prune origin \"+refs/heads/*:refs/heads/*\"", repository.url)
6565
updater.call
6666
end
6767

0 commit comments

Comments
 (0)