difit 3.1.11 → 3.1.13

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/cli/utils.js CHANGED
@@ -25,7 +25,10 @@ export function shouldReadStdin(options) {
25
25
  }
26
26
  export function getGitRoot() {
27
27
  try {
28
- const result = execSync('git rev-parse --show-toplevel', { encoding: 'utf8', stdio: 'pipe' });
28
+ const result = execSync('git rev-parse --show-toplevel', {
29
+ encoding: 'utf8',
30
+ stdio: 'pipe',
31
+ });
29
32
  return result.trim();
30
33
  }
31
34
  catch {
@@ -123,12 +126,12 @@ export function parseGitHubPrUrl(url) {
123
126
  }
124
127
  export function getPrPatch(prArg) {
125
128
  try {
126
- const patch = execFileSync('gh', ['pr', 'diff', prArg, '--patch'], {
129
+ const patch = execFileSync('gh', ['pr', 'diff', prArg], {
127
130
  encoding: 'utf8',
128
131
  stdio: ['ignore', 'pipe', 'pipe'],
129
132
  });
130
133
  if (!patch.trim()) {
131
- throw new Error('No patch content returned from gh pr diff --patch');
134
+ throw new Error('No diff content returned from gh pr diff');
132
135
  }
133
136
  return patch;
134
137
  }
@@ -168,7 +171,10 @@ export function validateDiffArguments(targetCommitish, baseCommitish) {
168
171
  }
169
172
  // Cannot compare same values
170
173
  if (targetCommitish === baseCommitish) {
171
- return { valid: false, error: `Cannot compare ${targetCommitish} with itself` };
174
+ return {
175
+ valid: false,
176
+ error: `Cannot compare ${targetCommitish} with itself`,
177
+ };
172
178
  }
173
179
  // "working" shows unstaged changes and can only be compared with staging area
174
180
  if (targetCommitish === 'working' && baseCommitish && baseCommitish !== 'staged') {