diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-06-14 13:36:53 +0200 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-06-19 09:41:09 +0200 |
commit | 5053dc84b06d09fa87032eb4ad9f2612ea852d59 (patch) | |
tree | e7027e103e153605cc4fcdb8a8730cf7f2adf244 | |
parent | 41d01281cef0ae5c26f08c73df3e8f9078dcf1d3 (diff) | |
download | gitlab-ce-5053dc84b06d09fa87032eb4ad9f2612ea852d59.tar.gz |
Rebase and Squash in progress are Gitaly only
Closes https://gitlab.com/gitlab-org/gitaly/issues/865
Closes https://gitlab.com/gitlab-org/gitaly/issues/1018
-rw-r--r-- | lib/gitlab/git/repository.rb | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index eb5d6318dcb..b0913e98ec6 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -1252,12 +1252,8 @@ module Gitlab end def rebase_in_progress?(rebase_id) - gitaly_migrate(:rebase_in_progress) do |is_enabled| - if is_enabled - gitaly_repository_client.rebase_in_progress?(rebase_id) - else - fresh_worktree?(worktree_path(REBASE_WORKTREE_PREFIX, rebase_id)) - end + wrapped_gitaly_errors do + gitaly_repository_client.rebase_in_progress?(rebase_id) end end @@ -1273,12 +1269,8 @@ module Gitlab end def squash_in_progress?(squash_id) - gitaly_migrate(:squash_in_progress, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled| - if is_enabled - gitaly_repository_client.squash_in_progress?(squash_id) - else - fresh_worktree?(worktree_path(SQUASH_WORKTREE_PREFIX, squash_id)) - end + wrapped_gitaly_errors do + gitaly_repository_client.squash_in_progress?(squash_id) end end @@ -1621,21 +1613,6 @@ module Gitlab end end - # This function is duplicated in Gitaly-Go, don't change it! - # https://gitlab.com/gitlab-org/gitaly/merge_requests/698 - def fresh_worktree?(path) - File.exist?(path) && !clean_stuck_worktree(path) - end - - # This function is duplicated in Gitaly-Go, don't change it! - # https://gitlab.com/gitlab-org/gitaly/merge_requests/698 - def clean_stuck_worktree(path) - return false unless File.mtime(path) < 15.minutes.ago - - FileUtils.rm_rf(path) - true - end - # Adding a worktree means checking out the repository. For large repos, # this can be very expensive, so set up sparse checkout for the worktree # to only check out the files we're interested in. |