diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-01-26 19:22:44 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-01-26 19:22:44 +0800 |
commit | 9bb4cd75ad51f61a53a2bef205be2b4b24acc513 (patch) | |
tree | c08e187341256e6ab273e778666512e9f3b7521a | |
parent | acda0cd48d69dbd98ec9df8339f15139cd098726 (diff) | |
download | gitlab-ce-9bb4cd75ad51f61a53a2bef205be2b4b24acc513.tar.gz |
Use commit rather than branch, and rename to avoid confusion
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7237#note_21626953
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7237#note_21626952
-rw-r--r-- | app/models/repository.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index f3a0148c423..6c847e07c00 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -996,10 +996,10 @@ class Repository end end - def check_revert_content(commit, branch_name) - source_sha = find_branch(branch_name).dereferenced_target.sha - args = [commit.id, source_sha] - args << { mainline: 1 } if commit.merge_commit? + def check_revert_content(target_commit, branch_name) + source_sha = commit(branch_name).sha + args = [target_commit.sha, source_sha] + args << { mainline: 1 } if target_commit.merge_commit? revert_index = rugged.revert_commit(*args) return false if revert_index.conflicts? @@ -1010,10 +1010,10 @@ class Repository tree_id end - def check_cherry_pick_content(commit, branch_name) - source_sha = find_branch(branch_name).dereferenced_target.sha - args = [commit.id, source_sha] - args << 1 if commit.merge_commit? + def check_cherry_pick_content(target_commit, branch_name) + source_sha = commit(branch_name).sha + args = [target_commit.sha, source_sha] + args << 1 if target_commit.merge_commit? cherry_pick_index = rugged.cherrypick_commit(*args) return false if cherry_pick_index.conflicts? |