diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-11-15 08:10:32 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-11-15 08:10:32 +0800 |
commit | 39d83f72e7af78d503ef278e22eda25f90322f4b (patch) | |
tree | bdf92472695fe2ab683f663c0251a16a1b3239df | |
parent | a68a62011d03c15d6116dc1e6dcb9514040a51f5 (diff) | |
download | gitlab-ce-39d83f72e7af78d503ef278e22eda25f90322f4b.tar.gz |
Add a few comments to explain implementation detail
-rw-r--r-- | app/models/repository.rb | 2 | ||||
-rw-r--r-- | app/services/files/base_service.rb | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index c4bdc84348e..4e3e70192ab 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -1121,6 +1121,8 @@ class Repository fetch_ref(path_to_repo, ref, ref_path) end + # Whenever `source_branch` is passed, if `branch` doesn't exist, it would + # be created from `source_branch`. def update_branch_with_hooks(current_user, branch, source_branch: nil) update_autocrlf_option diff --git a/app/services/files/base_service.rb b/app/services/files/base_service.rb index fd62246eddb..8689c83d40e 100644 --- a/app/services/files/base_service.rb +++ b/app/services/files/base_service.rb @@ -75,6 +75,9 @@ module Files validate_target_branch if @source_project != project + # Make sure we have the source_branch in target project, + # and use source_branch as target_branch directly to avoid + # unnecessary source branch in target project. @project.fetch_ref(@source_project, @target_branch, @source_branch) end end |