summaryrefslogtreecommitdiff
path: root/lib/API/GitForge/Role/GitForge.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/API/GitForge/Role/GitForge.pm')
-rw-r--r--lib/API/GitForge/Role/GitForge.pm9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/API/GitForge/Role/GitForge.pm b/lib/API/GitForge/Role/GitForge.pm
index 78d3498..c3459bf 100644
--- a/lib/API/GitForge/Role/GitForge.pm
+++ b/lib/API/GitForge/Role/GitForge.pm
@@ -126,13 +126,12 @@ sub clean_fork {
$self->_clean_config_fork($_[0]);
- # TODO use API to unprotect all branches in the fork. we still
- # want to use git-push(1) to delete the branches, rather than
- # using the API for that, because that's maximally compatible
-
# assume that if we had to create the gitforge branch, we just
# created the fork, so can go ahead and nuke all branches there.
- # may fail if some branches are protected; that's okay.
+ if ($self->can("_ensure_fork_branch_unprotected")) {
+ $self->_ensure_fork_branch_unprotected($_[0], $_) for @fork_branches;
+ }
+ # may fail if we couldn't unprotect; that's okay
eval { $git->push($fork_uri, "--delete", @fork_branches) };
return $fork_uri;