@panoptic-it-solutions/coolify-setup 1.1.28 → 1.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/git.js +12 -2
- package/package.json +1 -1
package/dist/git.js
CHANGED
|
@@ -256,8 +256,18 @@ export async function setupGitHub(projectName) {
|
|
|
256
256
|
}
|
|
257
257
|
catch {
|
|
258
258
|
// Checkout failed - might be worktree issue
|
|
259
|
-
// Try to push current branch to develop instead
|
|
259
|
+
// Try to push current branch to develop instead (if fast-forward possible)
|
|
260
260
|
try {
|
|
261
|
+
// First fetch to check if develop exists remotely
|
|
262
|
+
try {
|
|
263
|
+
run('git fetch origin develop');
|
|
264
|
+
// Check if current branch contains all develop commits (fast-forward possible)
|
|
265
|
+
run(`git merge-base --is-ancestor origin/develop ${currentBranch}`);
|
|
266
|
+
}
|
|
267
|
+
catch {
|
|
268
|
+
// Either develop doesn't exist remotely, or can't fast-forward
|
|
269
|
+
// Try push anyway - will fail if develop exists and diverged
|
|
270
|
+
}
|
|
261
271
|
run(`git push origin ${currentBranch}:develop -u`);
|
|
262
272
|
result.developBranchCreated = true;
|
|
263
273
|
result.repoPushed = true;
|
|
@@ -265,7 +275,7 @@ export async function setupGitHub(projectName) {
|
|
|
265
275
|
checkoutSucceeded = false;
|
|
266
276
|
}
|
|
267
277
|
catch {
|
|
268
|
-
result.warnings.push('Failed to push develop branch (checkout failed, possibly worktree conflict)');
|
|
278
|
+
result.warnings.push('Failed to push develop branch (checkout failed, possibly worktree conflict or branches diverged)');
|
|
269
279
|
checkoutSucceeded = false;
|
|
270
280
|
}
|
|
271
281
|
}
|