summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Carlbäcker <kim.carlbacker@gmail.com>2018-05-04 10:45:20 +0000
committerKim Carlbäcker <kim.carlbacker@gmail.com>2018-05-04 10:45:20 +0000
commit3fe555a751274538390b3f61b2cc5ff576d62785 (patch)
tree2694c12ee3aa4204fb1726a23df1afb0209b27bc
parent4cfa8168a204b42d2982a6817c9ba6c960ae62b3 (diff)
downloadgitlab-ce-3fe555a751274538390b3f61b2cc5ff576d62785.tar.gz
Add note about rebase/squash duplication in Gitaly
-rw-r--r--lib/gitlab/git/repository.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index 84d37f77fbb..2ec720a93b9 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -20,6 +20,9 @@ module Gitlab
GIT_ALTERNATE_OBJECT_DIRECTORIES_RELATIVE
].freeze
SEARCH_CONTEXT_LINES = 3
+ # In https://gitlab.com/gitlab-org/gitaly/merge_requests/698
+ # We copied these two prefixes into gitaly-go, so don't change these
+ # or things will break! (REBASE_WORKTREE_PREFIX and SQUASH_WORKTREE_PREFIX)
REBASE_WORKTREE_PREFIX = 'rebase'.freeze
SQUASH_WORKTREE_PREFIX = 'squash'.freeze
GITALY_INTERNAL_URL = 'ssh://gitaly/internal.git'.freeze
@@ -1671,10 +1674,14 @@ 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