git-stack-cli 1.5.0 → 1.5.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.
@@ -27878,6 +27878,9 @@ function parse(body) {
27878
27878
  // skip invalid row
27879
27879
  continue;
27880
27880
  }
27881
+ if (!RE.pr_url.test(parsed_row.pr_url)) {
27882
+ continue;
27883
+ }
27881
27884
  result.set(parsed_row.pr_url, parsed_row);
27882
27885
  }
27883
27886
  return result;
@@ -27898,6 +27901,7 @@ const RE = {
27898
27901
  num: "(?<num>\\d+)",
27899
27902
  pr_url: "(?<pr_url>.+)",
27900
27903
  })),
27904
+ pr_url: /^https:\/\/.*$/,
27901
27905
  };
27902
27906
 
27903
27907
  function ManualRebase() {
@@ -34418,7 +34422,7 @@ async function command() {
34418
34422
  .wrap(123)
34419
34423
  // disallow unknown options
34420
34424
  .strict()
34421
- .version("1.5.0" )
34425
+ .version("1.5.1" )
34422
34426
  .showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`")
34423
34427
  .help("help", "Show usage via `git stack help`").argv);
34424
34428
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-stack-cli",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "",
5
5
  "author": "magus",
6
6
  "license": "MIT",
@@ -155,3 +155,41 @@ test("persists removed pr urls from previous stack table", () => {
155
155
 
156
156
  expect(rerun_output).toBe(output);
157
157
  });
158
+
159
+ test("persist only valid urls, removed broken branch ids from interrupted sync", () => {
160
+ const args = {
161
+ body: [
162
+ "Summary of problem",
163
+ "",
164
+ "#### git stack",
165
+ "- ✅ `1` https://github.com/magus/git-multi-diff-playground/pull/43",
166
+ "- ✅ `2` gs-P4EBkJm+q",
167
+ "- 👉 `3` https://github.com/magus/git-multi-diff-playground/pull/47",
168
+ ].join("\n"),
169
+
170
+ pr_url_list: [
171
+ "https://github.com/magus/git-multi-diff-playground/pull/47",
172
+ "https://github.com/magus/git-multi-diff-playground/pull/54",
173
+ "https://github.com/magus/git-multi-diff-playground/pull/61",
174
+ ],
175
+
176
+ selected_url: "https://github.com/magus/git-multi-diff-playground/pull/47",
177
+ };
178
+
179
+ const output = StackSummaryTable.write(args);
180
+
181
+ expect(output.split("\n")).toEqual([
182
+ "Summary of problem",
183
+ "",
184
+ "#### git stack",
185
+ "- ✅ `1` https://github.com/magus/git-multi-diff-playground/pull/43",
186
+ "- 👉 `2` https://github.com/magus/git-multi-diff-playground/pull/47",
187
+ "- ⏳ `3` https://github.com/magus/git-multi-diff-playground/pull/54",
188
+ "- ⏳ `4` https://github.com/magus/git-multi-diff-playground/pull/61",
189
+ ]);
190
+
191
+ // run again on the output to make sure it doesn't change
192
+ const rerun_output = StackSummaryTable.write({ ...args, body: output });
193
+
194
+ expect(rerun_output).toBe(output);
195
+ });
@@ -88,6 +88,10 @@ export function parse(body: string): Map<string, StackTableRow> {
88
88
  continue;
89
89
  }
90
90
 
91
+ if (!RE.pr_url.test(parsed_row.pr_url)) {
92
+ continue;
93
+ }
94
+
91
95
  result.set(parsed_row.pr_url, parsed_row);
92
96
  }
93
97
 
@@ -117,6 +121,8 @@ const RE = {
117
121
  pr_url: "(?<pr_url>.+)",
118
122
  })
119
123
  ),
124
+
125
+ pr_url: /^https:\/\/.*$/,
120
126
  };
121
127
 
122
128
  type StackTableRow = {