Add a comment explaining how the branch clean up happens
This commit is contained in:
parent
7c85d6af96
commit
be108ae6f0
1 changed files with 6 additions and 0 deletions
|
@ -103,6 +103,12 @@ module Github
|
|||
end
|
||||
|
||||
def remove_source_branch!
|
||||
# We should remove the source/target branches only if they were
|
||||
# restored. Otherwise, we'll remove branches like 'master' that
|
||||
# target_branch_exists? returns true. In other words, we need
|
||||
# to clean up only the restored branches that (source|target)_branch_exists?
|
||||
# returns false for the first time it has been called, because of
|
||||
# this that is important to memoize these values.
|
||||
source_branch.remove!(source_branch_name) unless source_branch_exists?
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue