Skip to content

Commit 680c0dd

Browse files
committed
fix: set branch explicitly to prevent pushes to fail in some cases
1 parent 6ee7b20 commit 680c0dd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/KirbyGitHelper.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ public function commit($commitMessage, $author = null)
8484
public function push($branch = false)
8585
{
8686
$branch = $branch ? $branch : $this->branch;
87+
88+
// if branch is still empty we use the active branch
89+
// because otherwise pushes fail silently in some cases
90+
if (!$branch) {
91+
$branch = $this->getRepo()->getActiveBranch();
92+
}
93+
8794
$this->getRepo()->push('origin', $branch);
8895
}
8996

0 commit comments

Comments
 (0)