Browse Source

Fixes force push error messaging

main
Eric Amodio 1 year ago
parent
commit
034f1cd9ee
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/env/node/git/git.ts

+ 2
- 2
src/env/node/git/git.ts View File

@ -929,12 +929,12 @@ export class Git {
} else if (GitErrors.pushRejected.test(msg) || GitErrors.pushRejected.test(ex.stderr ?? '')) {
if (options?.force?.withLease) {
if (/! \[rejected\].*\(stale info\)/m.test(ex.stderr || '')) {
reason = PushErrorReason.PushRejected;
reason = PushErrorReason.PushRejectedWithLease;
} else if (
options.force.ifIncludes &&
/! \[rejected\].*\(remote ref updated since checkout\)/m.test(ex.stderr || '')
) {
reason = PushErrorReason.PushRejected;
reason = PushErrorReason.PushRejectedWithLeaseIfIncludes;
} else {
reason = PushErrorReason.PushRejected;
}

Loading…
Cancel
Save