summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-26 20:57:42 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-26 20:57:42 -0800
commita3d879d427c1236d26832dcd0312b3e0d6158bbe (patch)
treed47405d5a9cb7bf9ab2bd42503d978457cb3a097 /lib
parentaac36b120ef86469feb05ae5db39205493f851ed (diff)
downloadgitlab-ce-a3d879d427c1236d26832dcd0312b3e0d6158bbe.tar.gz
Refactor web editor
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/satellite/files/new_file_action.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitlab/satellite/files/new_file_action.rb b/lib/gitlab/satellite/files/new_file_action.rb
index c230239d390..5b657c7aba2 100644
--- a/lib/gitlab/satellite/files/new_file_action.rb
+++ b/lib/gitlab/satellite/files/new_file_action.rb
@@ -15,12 +15,12 @@ module Gitlab
# create target branch in satellite at the corresponding commit from bare repo
current_ref =
- if repo.commits.any?
- repo.git.checkout({raise: true, timeout: true, b: true}, ref, "origin/#{ref}")
- ref
- else
+ if @project.empty_repo?
# skip this step if we want to add first file to empty repo
Satellite::PARKING_BRANCH
+ else
+ repo.git.checkout({raise: true, timeout: true, b: true}, ref, "origin/#{ref}")
+ ref
end
file_path_in_satellite = File.join(repo.working_dir, file_path)