edsger 0.9.0 → 0.9.1

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.
@@ -36,7 +36,22 @@ const pushChanges = (verbose) => {
36
36
  }
37
37
  }
38
38
  catch (error) {
39
- throw new Error(`Failed to push changes: ${error instanceof Error ? error.message : String(error)}`);
39
+ // If push fails due to non-fast-forward, use force-with-lease for safer force push
40
+ // force-with-lease ensures we don't overwrite others' work by checking remote state
41
+ if (verbose) {
42
+ logInfo(`⚠️ Push rejected, attempting force push with lease...`);
43
+ }
44
+ try {
45
+ execSync('git push --force-with-lease origin $(git branch --show-current)', {
46
+ encoding: 'utf-8',
47
+ });
48
+ if (verbose) {
49
+ logInfo(`✅ Successfully force pushed changes`);
50
+ }
51
+ }
52
+ catch (forceError) {
53
+ throw new Error(`Failed to push changes: ${forceError instanceof Error ? forceError.message : String(forceError)}`);
54
+ }
40
55
  }
41
56
  };
42
57
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edsger",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "edsger": "dist/index.js"