troxy-cli 1.30.17 → 1.30.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "troxy-cli",
3
- "version": "1.30.17",
3
+ "version": "1.30.18",
4
4
  "description": "Make your Claude Code usage go further: lighter requests, less usage, less money",
5
5
  "homepage": "https://troxy.io",
6
6
  "bugs": {
@@ -116,12 +116,10 @@ const RULES = [
116
116
  const paths = pathArgs(segment, 2).filter((w) => !w.startsWith('-'));
117
117
  return { action_verb: 'delete', resource: summarizeResource(paths, 'a branch'), item_count: 1 };
118
118
  }
119
- if (/^git\s+push\b/.test(segment) && (/\s--delete\b/.test(segment) || /\s\S*:\S+/.test(segment))) {
120
- // `git push origin :branch` (empty source = delete) and
121
- // `git push origin local:branch` both use the same refspec shape;
122
- // either way the part after the colon is the remote branch being
123
- // touched, which is what matters here regardless of which it deletes.
124
- const target = segment.match(/--delete\s+(\S+)/)?.[1] || segment.match(/\s\S*:(\S+)/)?.[1];
119
+ if (/^git\s+push\b/.test(segment) && (/\s--delete\b/.test(segment) || /\s:\S+/.test(segment))) {
120
+ // Only an empty source (`git push origin :branch`) deletes.
121
+ // `git push origin HEAD:main` is a normal push, not a delete.
122
+ const target = segment.match(/--delete\s+(\S+)/)?.[1] || segment.match(/\s:(\S+)/)?.[1];
125
123
  return { action_verb: 'delete', resource: target || 'a remote branch', item_count: 1 };
126
124
  }
127
125
  return null;
@@ -86,6 +86,10 @@ describe('actionFor - git force push / branch delete', () => {
86
86
  assert.equal(bash('git push origin --delete old-feature').action_verb, 'delete');
87
87
  assert.equal(bash('git push origin :old-feature').action_verb, 'delete');
88
88
  });
89
+
90
+ it('does not treat a normal src:dst push as a delete', () => {
91
+ assert.equal(bash('git push -q origin HEAD:main'), null);
92
+ });
89
93
  });
90
94
 
91
95
  describe('actionFor - terraform / kubectl / docker / aws', () => {