summaryrefslogtreecommitdiff
path: root/lib/gitlab/github_import/importer.rb
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 /lib/gitlab/github_import/importer.rb
parent74849f9783850676274a4e93a1b6335b5bb34f2e (diff)
downloadgitlab-ce-3b4f03de8fb0de0b882d499c9259f053fa69d9e6.tar.gz
Ensure branch cleanup regardless of whether the import process succeedsgh-branch-cleanup
Diffstat (limited to 'lib/gitlab/github_import/importer.rb')
-rw-r--r--lib/gitlab/github_import/importer.rb4
1 files changed, 2 insertions, 2 deletions
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)