Skip to content
Snippets Groups Projects
Commit 5de74551 authored by Lin Jen-Shin's avatar Lin Jen-Shin
Browse files

Branch could be nil if it's an empty repo

parent 30bcc3de
No related branches found
No related tags found
1 merge request!7237Don't execute git hooks if you create branch as part of other change
Loading
@@ -901,10 +901,15 @@ class Repository
Loading
@@ -901,10 +901,15 @@ class Repository
branch, branch,
source_branch: source_branch) do |ref| source_branch: source_branch) do |ref|
index = rugged.index index = rugged.index
branch_commit = find_branch(ref)
last_commit = find_branch(ref).dereferenced_target
index.read_tree(last_commit.raw_commit.tree) parents = if branch_commit
parents = [last_commit.sha] last_commit = branch_commit.dereferenced_target
index.read_tree(last_commit.raw_commit.tree)
[last_commit.sha]
else
[]
end
   
actions.each do |action| actions.each do |action|
case action[:action] case action[:action]
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment