diff --git a/Gemfile b/Gemfile
index d790e515afe6155c9544f7a37eee2ee6fd8c1fd8..2f0575e93ca8777353a6cb322b420b3e7c29e724 100644
--- a/Gemfile
+++ b/Gemfile
@@ -24,7 +24,7 @@ gem 'omniauth-github'
 # Extracting information from a git repository
 # We cannot use original git since some bugs
 gem "grit", '~> 2.5.0', git: 'https://github.com/gitlabhq/grit.git', ref: '42297cdcee16284d2e4eff23d41377f52fc28b9d'
-gem 'gitlab_git', '~> 1.0.4'
+gem 'gitlab_git', '~> 1.0.5'
 
 # Ruby/Rack Git Smart-HTTP Server Handler
 gem 'gitlab-grack', '~> 1.0.0', require: 'grack'
diff --git a/Gemfile.lock b/Gemfile.lock
index a70b3c7e09aee6304df881bc5cbd7fc3309d4996..64d351a1f98adf5bebf3c972ccc7f126e9b60fe7 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -164,7 +164,7 @@ GEM
     gitlab-pygments.rb (0.3.2)
       posix-spawn (~> 0.3.6)
       yajl-ruby (~> 1.1.0)
-    gitlab_git (1.0.4)
+    gitlab_git (1.0.5)
       activesupport (~> 3.2.13)
       github-linguist (~> 2.3.4)
       grit (~> 2.5.0)
@@ -506,7 +506,7 @@ DEPENDENCIES
   github-markup (~> 0.7.4)
   gitlab-grack (~> 1.0.0)
   gitlab-pygments.rb (~> 0.3.2)
-  gitlab_git (~> 1.0.4)
+  gitlab_git (~> 1.0.5)
   gitlab_meta (= 5.0)
   gitlab_omniauth-ldap (= 1.0.2)
   gollum-lib (~> 1.0.0)
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index 6fba251830652c30f7b674083ea0ed80c251931f..a7d393af82b91e01437d933dd8b82a80d4095a76 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -27,7 +27,9 @@ class RepositoriesController < ProjectResourceController
     end
 
 
-    file_path = @repository.archive_repo(params[:ref])
+    storage_path = Rails.root.join("tmp", "repositories")
+
+    file_path = @repository.archive_repo(params[:ref], storage_path)
 
     if file_path
       # Send file to user