type-git 0.8.1 → 0.8.3

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/README.md CHANGED
@@ -175,6 +175,9 @@ const result = await repo.raw(['rev-parse', 'HEAD']);
175
175
 
176
176
  // Send data on stdin instead of putting it in argv
177
177
  const { stdout: blobId } = await repo.raw(['hash-object', '-w', '--stdin'], { stdin: 'hello' });
178
+
179
+ // raw() returns a non-zero exit in exitCode; throwOnNonZero throws the typed GitError instead
180
+ const { stdout: head } = await repo.raw(['rev-parse', 'HEAD'], { throwOnNonZero: true });
178
181
  ```
179
182
 
180
183
  ### Audit Mode
@@ -5,8 +5,8 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkUHZWPYTFcjs = require('../../chunk-UHZWPYTF.cjs');
9
- require('../../chunk-6HDMSFY7.cjs');
8
+ var _chunkSNC324NLcjs = require('../../chunk-SNC324NL.cjs');
9
+ require('../../chunk-QHIS7LHW.cjs');
10
10
 
11
11
  // src/adapters/bun/exec.ts
12
12
  function resolveChildEnv(env, inheritEnv) {
@@ -117,7 +117,7 @@ var BunExecAdapter = class {
117
117
  let stderr = "";
118
118
  if (binary) {
119
119
  [stdout, stderr] = await Promise.all([
120
- proc.stdout ? _chunkUHZWPYTFcjs.readBytes.call(void 0, proc.stdout) : Promise.resolve(new Uint8Array(0)),
120
+ proc.stdout ? _chunkSNC324NLcjs.readBytes.call(void 0, proc.stdout) : Promise.resolve(new Uint8Array(0)),
121
121
  proc.stderr ? readStream(proc.stderr, _optionalChain([handlers, 'optionalAccess', _4 => _4.onStderr])) : Promise.resolve("")
122
122
  ]);
123
123
  } else if (_optionalChain([handlers, 'optionalAccess', _5 => _5.onStdout]) || _optionalChain([handlers, 'optionalAccess', _6 => _6.onStderr])) {
@@ -294,7 +294,7 @@ var BunFsAdapter = (_class = class {constructor() { _class.prototype.__init.call
294
294
  },
295
295
  sleep: (ms) => Bun.sleep(ms)
296
296
  };
297
- await _chunkUHZWPYTFcjs.runTailPolling.call(void 0, { adapter, signal, pollInterval, onLine });
297
+ await _chunkSNC324NLcjs.runTailPolling.call(void 0, { adapter, signal, pollInterval, onLine });
298
298
  }
299
299
  async deleteFile(filePath) {
300
300
  const tempDir = this.tempFileDirs.get(filePath);
@@ -349,7 +349,7 @@ var BunFsAdapter = (_class = class {constructor() { _class.prototype.__init.call
349
349
  },
350
350
  sleep: (ms) => Bun.sleep(ms)
351
351
  };
352
- return _chunkUHZWPYTFcjs.createTailPolling.call(void 0, { adapter, signal, pollInterval });
352
+ return _chunkSNC324NLcjs.createTailPolling.call(void 0, { adapter, signal, pollInterval });
353
353
  }
354
354
  }, _class);
355
355
 
@@ -360,13 +360,13 @@ function createBunAdapters() {
360
360
  fs: new BunFsAdapter()
361
361
  };
362
362
  }
363
- var TypeGit = class _TypeGit extends _chunkUHZWPYTFcjs.GitClient {
363
+ var TypeGit = class _TypeGit extends _chunkSNC324NLcjs.GitClient {
364
364
  static async create(options) {
365
- return new _TypeGit(await _chunkUHZWPYTFcjs.createGit.call(void 0, { ...options, adapters: createBunAdapters() }));
365
+ return new _TypeGit(await _chunkSNC324NLcjs.createGit.call(void 0, { ...options, adapters: createBunAdapters() }));
366
366
  }
367
367
  constructor(optionsOrGit) {
368
368
  super(
369
- optionsOrGit && "open" in optionsOrGit ? optionsOrGit : _chunkUHZWPYTFcjs.createGitSync.call(void 0, { ...optionsOrGit, adapters: createBunAdapters() })
369
+ optionsOrGit && "open" in optionsOrGit ? optionsOrGit : _chunkSNC324NLcjs.createGitSync.call(void 0, { ...optionsOrGit, adapters: createBunAdapters() })
370
370
  );
371
371
  }
372
372
  };
@@ -1,5 +1,5 @@
1
- import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-Cg5wWJnY.cjs';
2
- import { C as Capabilities, G as Git } from '../../git.d-DqAvRXEf.cjs';
1
+ import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-Jwli7Qfw.cjs';
2
+ import { C as Capabilities, G as Git } from '../../git.d-BTNkPofF.cjs';
3
3
 
4
4
  /**
5
5
  * Bun ExecAdapter implementation
@@ -1,5 +1,5 @@
1
- import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-DCiFA_CK.js';
2
- import { C as Capabilities, G as Git } from '../../git.d-DqAvRXEf.cjs';
1
+ import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-ClMefrEh.js';
2
+ import { C as Capabilities, G as Git } from '../../git.d-BTNkPofF.cjs';
3
3
 
4
4
  /**
5
5
  * Bun ExecAdapter implementation
@@ -5,8 +5,8 @@ import {
5
5
  createTailPolling,
6
6
  readBytes,
7
7
  runTailPolling
8
- } from "../../chunk-ADC26634.js";
9
- import "../../chunk-UAKOSACD.js";
8
+ } from "../../chunk-HCQGGKTC.js";
9
+ import "../../chunk-V4ZRQG3O.js";
10
10
 
11
11
  // src/adapters/bun/exec.ts
12
12
  function resolveChildEnv(env, inheritEnv) {
@@ -5,8 +5,8 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkUHZWPYTFcjs = require('../../chunk-UHZWPYTF.cjs');
9
- require('../../chunk-6HDMSFY7.cjs');
8
+ var _chunkSNC324NLcjs = require('../../chunk-SNC324NL.cjs');
9
+ require('../../chunk-QHIS7LHW.cjs');
10
10
 
11
11
  // src/adapters/deno/exec.ts
12
12
  function resolveChildEnvOptions(env, inheritEnv) {
@@ -141,7 +141,7 @@ var DenoExecAdapter = class {
141
141
  let stderr = "";
142
142
  if (binary) {
143
143
  [stdout, stderr] = await Promise.all([
144
- child.stdout ? _chunkUHZWPYTFcjs.readBytes.call(void 0, child.stdout) : Promise.resolve(new Uint8Array(0)),
144
+ child.stdout ? _chunkSNC324NLcjs.readBytes.call(void 0, child.stdout) : Promise.resolve(new Uint8Array(0)),
145
145
  child.stderr ? readStream(child.stderr, _optionalChain([handlers, 'optionalAccess', _4 => _4.onStderr])) : Promise.resolve("")
146
146
  ]);
147
147
  } else if (_optionalChain([handlers, 'optionalAccess', _5 => _5.onStdout]) || _optionalChain([handlers, 'optionalAccess', _6 => _6.onStderr])) {
@@ -357,7 +357,7 @@ var DenoFsAdapter = (_class = class {constructor() { _class.prototype.__init.cal
357
357
  },
358
358
  sleep: (ms) => delay(ms)
359
359
  };
360
- await _chunkUHZWPYTFcjs.runTailPolling.call(void 0, { adapter, signal, pollInterval, onLine });
360
+ await _chunkSNC324NLcjs.runTailPolling.call(void 0, { adapter, signal, pollInterval, onLine });
361
361
  }
362
362
  async deleteFile(filePath) {
363
363
  const tempDir = this.tempFileDirs.get(filePath);
@@ -443,7 +443,7 @@ var DenoFsAdapter = (_class = class {constructor() { _class.prototype.__init.cal
443
443
  },
444
444
  sleep: (ms) => delay(ms)
445
445
  };
446
- return _chunkUHZWPYTFcjs.createTailPolling.call(void 0, { adapter, signal, pollInterval });
446
+ return _chunkSNC324NLcjs.createTailPolling.call(void 0, { adapter, signal, pollInterval });
447
447
  }
448
448
  }, _class);
449
449
 
@@ -454,13 +454,13 @@ function createDenoAdapters() {
454
454
  fs: new DenoFsAdapter()
455
455
  };
456
456
  }
457
- var TypeGit = class _TypeGit extends _chunkUHZWPYTFcjs.GitClient {
457
+ var TypeGit = class _TypeGit extends _chunkSNC324NLcjs.GitClient {
458
458
  static async create(options) {
459
- return new _TypeGit(await _chunkUHZWPYTFcjs.createGit.call(void 0, { ...options, adapters: createDenoAdapters() }));
459
+ return new _TypeGit(await _chunkSNC324NLcjs.createGit.call(void 0, { ...options, adapters: createDenoAdapters() }));
460
460
  }
461
461
  constructor(optionsOrGit) {
462
462
  super(
463
- optionsOrGit && "open" in optionsOrGit ? optionsOrGit : _chunkUHZWPYTFcjs.createGitSync.call(void 0, { ...optionsOrGit, adapters: createDenoAdapters() })
463
+ optionsOrGit && "open" in optionsOrGit ? optionsOrGit : _chunkSNC324NLcjs.createGitSync.call(void 0, { ...optionsOrGit, adapters: createDenoAdapters() })
464
464
  );
465
465
  }
466
466
  };
@@ -1,5 +1,5 @@
1
- import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-Cg5wWJnY.cjs';
2
- import { C as Capabilities, G as Git } from '../../git.d-DqAvRXEf.cjs';
1
+ import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-Jwli7Qfw.cjs';
2
+ import { C as Capabilities, G as Git } from '../../git.d-BTNkPofF.cjs';
3
3
 
4
4
  /**
5
5
  * Deno ExecAdapter implementation
@@ -1,5 +1,5 @@
1
- import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-DCiFA_CK.js';
2
- import { C as Capabilities, G as Git } from '../../git.d-DqAvRXEf.cjs';
1
+ import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-ClMefrEh.js';
2
+ import { C as Capabilities, G as Git } from '../../git.d-BTNkPofF.cjs';
3
3
 
4
4
  /**
5
5
  * Deno ExecAdapter implementation
@@ -5,8 +5,8 @@ import {
5
5
  createTailPolling,
6
6
  readBytes,
7
7
  runTailPolling
8
- } from "../../chunk-ADC26634.js";
9
- import "../../chunk-UAKOSACD.js";
8
+ } from "../../chunk-HCQGGKTC.js";
9
+ import "../../chunk-V4ZRQG3O.js";
10
10
 
11
11
  // src/adapters/deno/exec.ts
12
12
  function resolveChildEnvOptions(env, inheritEnv) {
@@ -3,12 +3,12 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkJDCCYWIXcjs = require('../../chunk-JDCCYWIX.cjs');
7
- require('../../chunk-UHZWPYTF.cjs');
8
- require('../../chunk-6HDMSFY7.cjs');
6
+ var _chunkI77B22ZEcjs = require('../../chunk-I77B22ZE.cjs');
7
+ require('../../chunk-SNC324NL.cjs');
8
+ require('../../chunk-QHIS7LHW.cjs');
9
9
 
10
10
 
11
11
 
12
12
 
13
13
 
14
- exports.NodeExecAdapter = _chunkJDCCYWIXcjs.NodeExecAdapter; exports.NodeFsAdapter = _chunkJDCCYWIXcjs.NodeFsAdapter; exports.TypeGit = _chunkJDCCYWIXcjs.TypeGit; exports.createNodeAdapters = _chunkJDCCYWIXcjs.createNodeAdapters;
14
+ exports.NodeExecAdapter = _chunkI77B22ZEcjs.NodeExecAdapter; exports.NodeFsAdapter = _chunkI77B22ZEcjs.NodeFsAdapter; exports.TypeGit = _chunkI77B22ZEcjs.TypeGit; exports.createNodeAdapters = _chunkI77B22ZEcjs.createNodeAdapters;
@@ -1,5 +1,5 @@
1
- import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-Cg5wWJnY.cjs';
2
- import { C as Capabilities, G as Git } from '../../git.d-DqAvRXEf.cjs';
1
+ import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-Jwli7Qfw.cjs';
2
+ import { C as Capabilities, G as Git } from '../../git.d-BTNkPofF.cjs';
3
3
 
4
4
  /**
5
5
  * Options for {@link NodeExecAdapter}.
@@ -1,5 +1,5 @@
1
- import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-DCiFA_CK.js';
2
- import { C as Capabilities, G as Git } from '../../git.d-DqAvRXEf.cjs';
1
+ import { E as ExecAdapter, S as SpawnOptions, a as StreamHandler, b as SpawnResult, c as SpawnHandle, F as FsAdapter, T as TailOptions, d as TailHandle, R as RuntimeAdapters, C as CreateGitOptions, G as GitClient } from '../../client.d-ClMefrEh.js';
2
+ import { C as Capabilities, G as Git } from '../../git.d-BTNkPofF.cjs';
3
3
 
4
4
  /**
5
5
  * Options for {@link NodeExecAdapter}.
@@ -3,9 +3,9 @@ import {
3
3
  NodeFsAdapter,
4
4
  TypeGit,
5
5
  createNodeAdapters
6
- } from "../../chunk-S3EFBFVP.js";
7
- import "../../chunk-ADC26634.js";
8
- import "../../chunk-UAKOSACD.js";
6
+ } from "../../chunk-MS6E5USB.js";
7
+ import "../../chunk-HCQGGKTC.js";
8
+ import "../../chunk-V4ZRQG3O.js";
9
9
  export {
10
10
  NodeExecAdapter,
11
11
  NodeFsAdapter,