Commit 9bb4cd75 authored by Lin Jen-Shin's avatar Lin Jen-Shin
parent acda0cd4
...@@ -996,10 +996,10 @@ class Repository ...@@ -996,10 +996,10 @@ class Repository
end end
end end
def check_revert_content(commit, branch_name) def check_revert_content(target_commit, branch_name)
source_sha = find_branch(branch_name).dereferenced_target.sha source_sha = commit(branch_name).sha
args = [commit.id, source_sha] args = [target_commit.sha, source_sha]
args << { mainline: 1 } if commit.merge_commit? args << { mainline: 1 } if target_commit.merge_commit?
revert_index = rugged.revert_commit(*args) revert_index = rugged.revert_commit(*args)
return false if revert_index.conflicts? return false if revert_index.conflicts?
...@@ -1010,10 +1010,10 @@ class Repository ...@@ -1010,10 +1010,10 @@ class Repository
tree_id tree_id
end end
def check_cherry_pick_content(commit, branch_name) def check_cherry_pick_content(target_commit, branch_name)
source_sha = find_branch(branch_name).dereferenced_target.sha source_sha = commit(branch_name).sha
args = [commit.id, source_sha] args = [target_commit.sha, source_sha]
args << 1 if commit.merge_commit? args << 1 if target_commit.merge_commit?
cherry_pick_index = rugged.cherrypick_commit(*args) cherry_pick_index = rugged.cherrypick_commit(*args)
return false if cherry_pick_index.conflicts? return false if cherry_pick_index.conflicts?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment