@feng0531/dsh-vcs 0.10.4 → 0.10.5

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": "@feng0531/dsh-vcs",
3
- "version": "0.10.4",
3
+ "version": "0.10.5",
4
4
  "private": false,
5
5
  "publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" },
6
6
  "type": "module",
package/vcs.mjs CHANGED
@@ -327,7 +327,7 @@ async function commitDetails(repo,{commit,parentIndex=0,signal}={},includeMessag
327
327
  if(typeof commit!=='string'||!isObjectId(commit))throw new Error('Invalid commit id');
328
328
  if(!Number.isInteger(parentIndex)||parentIndex<0)throw new Error('Invalid parent index');
329
329
  signal?.throwIfAborted();
330
- repo=await checkedGitRepo(repo,signal,'Commit details support Git only');
330
+ repo=await checkedGitRepo(repo,signal,'Commit details support Git only',undefined,false);
331
331
  const raw=await git(repo.root,['log','-z','--no-show-signature','--encoding=UTF-8','--max-count=1','--format='+HISTORY_FORMAT,commit,'--'],MAX_TEXT,{signal});
332
332
  const metadata=parseHistory(raw.toString('utf8'),1)[0];
333
333
  if(!metadata||metadata.id!==commit)throw new Error('Commit object required');
@@ -379,7 +379,7 @@ export async function getHistoricalSegment(repo, {commit,path:file,offset,line,s
379
379
  export async function getHistoricalFile(repo,{commit,path:file,signal}={}) {
380
380
  if(typeof file !== 'string' || !file || file.includes('\0')) throw Error('Invalid historical path');
381
381
  try {validateHistoricalPath(file);} catch {throw Error('Path is not part of selected commit');}
382
- repo = await checkedGitRepo(repo, signal, 'Historical file supports Git only');
382
+ repo = await checkedGitRepo(repo, signal, 'Historical file supports Git only', undefined, false);
383
383
  const entry = await historicalAccess.lookup(repo.root, {commit,path:file,signal});
384
384
  if (entry.type !== 'blob' || !['100644','100755'].includes(entry.mode)) throw Error('Historical file preview requires a regular file');
385
385
  const result = await content(() => git(repo.root, ['cat-file','blob',entry.oid], MAX_TEXT, {signal}));
@@ -388,13 +388,13 @@ export async function getHistoricalFile(repo,{commit,path:file,signal}={}) {
388
388
  }
389
389
 
390
390
  export async function getHistoricalTreePage(repo, options = {}) {
391
- repo = await checkedGitRepo(repo, options.signal, 'Historical tree supports Git only');
391
+ repo = await checkedGitRepo(repo, options.signal, 'Historical tree supports Git only', undefined, false);
392
392
  return historicalAccess.treePage(repo.root, options);
393
393
  }
394
394
 
395
395
  export async function getHistoricalTree(repo,{commit,signal}={}) {
396
396
  if(typeof commit!=='string'||!isObjectId(commit))throw new Error('Invalid commit id');
397
- repo=await checkedGitRepo(repo,signal,'Historical tree supports Git only');
397
+ repo=await checkedGitRepo(repo,signal,'Historical tree supports Git only',undefined,false);
398
398
  const type=(await git(repo.root,['cat-file','-t',commit],MAX_TEXT,{signal})).toString('utf8').trim();if(type!=='commit')throw new Error('Commit object required');
399
399
  const text=(await git(repo.root,['ls-tree','-r','-t','-z','--full-tree',commit],MAX_TEXT,{signal})).toString('utf8');
400
400
  const fields=text.split(String.fromCharCode(0));if(fields.pop()!=='')throw new Error('Truncated historical tree');
@@ -557,7 +557,7 @@ export async function listPathHistory(repo,{commit,path:file,offset=0,limit=50,f
557
557
 
558
558
  export async function getRevisionChanges(repo,{base,target,signal}={}){
559
559
  for(const oid of [base,target])if(typeof oid!=='string'||!isObjectId(oid))throw new Error('Invalid revision commit id');
560
- signal?.throwIfAborted();repo=await checkedGitRepo(repo,signal,'Revision comparison supports Git only');
560
+ signal?.throwIfAborted();repo=await checkedGitRepo(repo,signal,'Revision comparison supports Git only',undefined,false);
561
561
  for(const oid of new Set([base,target])){
562
562
  const type=(await git(repo.root,['cat-file','-t',oid],MAX_TEXT,{signal})).toString('utf8').trim();
563
563
  if(type!=='commit')throw new Error('Commit object required');