summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-06-02 19:48:11 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-06-02 19:48:11 -0300
commit3b4f03de8fb0de0b882d499c9259f053fa69d9e6 (patch)
treecbd1cd07e7782530ec1823729a8266746dca99fe
parent74849f9783850676274a4e93a1b6335b5bb34f2e (diff)
downloadgitlab-ce-gh-branch-cleanup.tar.gz
Ensure branch cleanup regardless of whether the import process succeedsgh-branch-cleanup
-rw-r--r--CHANGELOG3
-rw-r--r--lib/gitlab/github_import/importer.rb4
2 files changed, 5 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 68ea866968d..6ead604b724 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -32,6 +32,9 @@ v 8.9.0 (unreleased)
- Cache project build count in sidebar nav
- Reduce number of queries needed to render issue labels in the sidebar
+v 8.8.4 (unreleased)
+ - Ensure branch cleanup regardless of whether the GitHub import process succeeds
+
v 8.8.3
- Fix 404 page when viewing TODOs that contain milestones or labels in different projects. !4312
- Fixed JS error when trying to remove discussion form. !4303
diff --git a/lib/gitlab/github_import/importer.rb b/lib/gitlab/github_import/importer.rb
index 408d9b79632..9d077e79c39 100644
--- a/lib/gitlab/github_import/importer.rb
+++ b/lib/gitlab/github_import/importer.rb
@@ -89,11 +89,11 @@ module Gitlab
end
end
- delete_refs(branches_removed)
-
true
rescue ActiveRecord::RecordInvalid => e
raise Projects::ImportService::Error, e.message
+ ensure
+ delete_refs(branches_removed)
end
def create_refs(branches)