├── .cargo └── config.toml ├── .gitattributes ├── .github ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md └── workflows │ ├── ci.yml │ ├── docs.yaml │ └── release.yml ├── .gitignore ├── .node-version ├── .npmignore ├── .scripts └── prepare-next-release.ts ├── .yarn └── releases │ └── yarn-4.9.1.cjs ├── .yarnrc.yml ├── CHANGELOG.md ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README-ko_kr.md ├── README.md ├── benchmarks ├── README.md ├── index.bench.ts ├── nodegit │ ├── index.js │ ├── package-lock.json │ └── package.json ├── package.json ├── tsconfig.json ├── util.ts └── vitest.config.mts ├── biome.json ├── build.rs ├── docs ├── .gitignore ├── .vitepress │ ├── config.ts │ ├── en.ts │ ├── ko.ts │ ├── lib │ │ └── sidebar.ts │ ├── shared.ts │ └── theme │ │ ├── index.css │ │ └── index.js ├── README.md ├── gen │ ├── cli.ts │ ├── commands │ │ └── reference.ts │ ├── doc.ts │ ├── fs.ts │ ├── html.ts │ ├── lang.ts │ ├── texts.ts │ ├── translate.ts │ ├── typedoc.ts │ └── util.ts ├── getting-started.md ├── index.md ├── ko │ ├── getting-started.md │ ├── index.md │ ├── performance.md │ ├── reference │ │ ├── Blob │ │ │ └── Methods │ │ │ │ ├── content.md │ │ │ │ ├── id.md │ │ │ │ ├── isBinary.md │ │ │ │ └── size.md │ │ ├── Branch │ │ │ ├── Methods │ │ │ │ ├── delete.md │ │ │ │ ├── findUpstream.md │ │ │ │ ├── getUpstream.md │ │ │ │ ├── isHead.md │ │ │ │ ├── name.md │ │ │ │ ├── referenceTarget.md │ │ │ │ ├── rename.md │ │ │ │ ├── setUpstream.md │ │ │ │ └── unsetUpstream.md │ │ │ └── isValidBranchName.md │ │ ├── Commit │ │ │ └── Methods │ │ │ │ ├── asObject.md │ │ │ │ ├── author.md │ │ │ │ ├── body.md │ │ │ │ ├── committer.md │ │ │ │ ├── id.md │ │ │ │ ├── message.md │ │ │ │ ├── summary.md │ │ │ │ ├── time.md │ │ │ │ └── tree.md │ │ ├── Diff │ │ │ ├── DiffDelta │ │ │ │ ├── flags.md │ │ │ │ ├── newFile.md │ │ │ │ ├── numFiles.md │ │ │ │ ├── oldFile.md │ │ │ │ └── status.md │ │ │ ├── DiffFile │ │ │ │ ├── exists.md │ │ │ │ ├── id.md │ │ │ │ ├── isBinary.md │ │ │ │ ├── isValidId.md │ │ │ │ ├── mode.md │ │ │ │ ├── path.md │ │ │ │ └── size.md │ │ │ ├── Methods │ │ │ │ ├── deltas.md │ │ │ │ ├── findSimilar.md │ │ │ │ ├── isSortedIcase.md │ │ │ │ ├── merge.md │ │ │ │ ├── print.md │ │ │ │ └── stats.md │ │ │ └── diffFlagsContains.md │ │ ├── GitObject │ │ │ └── Methods │ │ │ │ ├── asCommit.md │ │ │ │ ├── id.md │ │ │ │ ├── peel.md │ │ │ │ ├── peelToBlob.md │ │ │ │ ├── peelToCommit.md │ │ │ │ └── type.md │ │ ├── Index │ │ │ └── Methods │ │ │ │ ├── addAll.md │ │ │ │ ├── addPath.md │ │ │ │ ├── count.md │ │ │ │ ├── entries.md │ │ │ │ ├── getByPath.md │ │ │ │ ├── hasConflicts.md │ │ │ │ ├── isEmpty.md │ │ │ │ ├── path.md │ │ │ │ ├── read.md │ │ │ │ ├── removeAll.md │ │ │ │ ├── removePath.md │ │ │ │ ├── setVersion.md │ │ │ │ ├── updateAll.md │ │ │ │ ├── version.md │ │ │ │ ├── write.md │ │ │ │ └── writeTree.md │ │ ├── Oid │ │ │ ├── hashFileOid.md │ │ │ ├── hashObjectOid.md │ │ │ ├── isValidOid.md │ │ │ ├── isZeroOid.md │ │ │ └── zeroOid.md │ │ ├── Reference │ │ │ ├── Methods │ │ │ │ ├── delete.md │ │ │ │ ├── isBranch.md │ │ │ │ ├── isNote.md │ │ │ │ ├── isRemote.md │ │ │ │ ├── isTag.md │ │ │ │ ├── name.md │ │ │ │ ├── peelToTree.md │ │ │ │ ├── rename.md │ │ │ │ ├── resolve.md │ │ │ │ ├── shorthand.md │ │ │ │ ├── symbolicTarget.md │ │ │ │ ├── target.md │ │ │ │ ├── targetPeel.md │ │ │ │ └── type.md │ │ │ ├── isValidReferenceName.md │ │ │ └── normalizeReferenceName.md │ │ ├── Remote │ │ │ └── Methods │ │ │ │ ├── defaultBranch.md │ │ │ │ ├── fetch.md │ │ │ │ ├── name.md │ │ │ │ ├── prune.md │ │ │ │ ├── push.md │ │ │ │ ├── pushurl.md │ │ │ │ ├── refspecs.md │ │ │ │ └── url.md │ │ ├── Repository │ │ │ ├── Methods │ │ │ │ ├── addIgnoreRule.md │ │ │ │ ├── blameFile.md │ │ │ │ ├── branches.md │ │ │ │ ├── checkoutHead.md │ │ │ │ ├── checkoutIndex.md │ │ │ │ ├── checkoutTree.md │ │ │ │ ├── cleanupState.md │ │ │ │ ├── clearIgnoreRules.md │ │ │ │ ├── commit.md │ │ │ │ ├── config.md │ │ │ │ ├── createAnnotationTag.md │ │ │ │ ├── createBranch.md │ │ │ │ ├── createLightweightTag.md │ │ │ │ ├── createRemote.md │ │ │ │ ├── createTag.md │ │ │ │ ├── deleteTag.md │ │ │ │ ├── diffIndexToIndex.md │ │ │ │ ├── diffIndexToWorkdir.md │ │ │ │ ├── diffTreeToTree.md │ │ │ │ ├── diffTreeToWorkdir.md │ │ │ │ ├── diffTreeToWorkdirWithIndex.md │ │ │ │ ├── extractSignature.md │ │ │ │ ├── findBranch.md │ │ │ │ ├── findCommit.md │ │ │ │ ├── findObject.md │ │ │ │ ├── findReference.md │ │ │ │ ├── findRemote.md │ │ │ │ ├── findStatusFile.md │ │ │ │ ├── findTag.md │ │ │ │ ├── findTree.md │ │ │ │ ├── getAnnotatedCommit.md │ │ │ │ ├── getAnnotatedCommitFromFetchHead.md │ │ │ │ ├── getAnnotatedCommitFromReference.md │ │ │ │ ├── getBranch.md │ │ │ │ ├── getCommit.md │ │ │ │ ├── getMergeBase.md │ │ │ │ ├── getMergeBaseMany.md │ │ │ │ ├── getMergeBaseOctopus.md │ │ │ │ ├── getMergeBases.md │ │ │ │ ├── getMergeBasesMany.md │ │ │ │ ├── getObject.md │ │ │ │ ├── getReference.md │ │ │ │ ├── getRemote.md │ │ │ │ ├── getStatusFile.md │ │ │ │ ├── getTag.md │ │ │ │ ├── getTree.md │ │ │ │ ├── head.md │ │ │ │ ├── headDetached.md │ │ │ │ ├── index.md │ │ │ │ ├── isBare.md │ │ │ │ ├── isEmpty.md │ │ │ │ ├── isPathIgnored.md │ │ │ │ ├── isShallow.md │ │ │ │ ├── isWorktree.md │ │ │ │ ├── mailmap.md │ │ │ │ ├── merge.md │ │ │ │ ├── mergeCommits.md │ │ │ │ ├── mergeTrees.md │ │ │ │ ├── path.md │ │ │ │ ├── remoteNames.md │ │ │ │ ├── revparse.md │ │ │ │ ├── revparseSingle.md │ │ │ │ ├── revwalk.md │ │ │ │ ├── setHead.md │ │ │ │ ├── setHeadDetached.md │ │ │ │ ├── setHeadDetachedFromAnnotated.md │ │ │ │ ├── state.md │ │ │ │ ├── statusShouldIgnore.md │ │ │ │ ├── statuses.md │ │ │ │ ├── tagForeach.md │ │ │ │ ├── tagNames.md │ │ │ │ └── workdir.md │ │ │ ├── cloneRepository.md │ │ │ ├── discoverRepository.md │ │ │ ├── initRepository.md │ │ │ └── openRepository.md │ │ ├── Revparse │ │ │ └── revparseModeContains.md │ │ ├── Revwalk │ │ │ └── Methods │ │ │ │ ├── hide.md │ │ │ │ ├── hideGlob.md │ │ │ │ ├── hideHead.md │ │ │ │ ├── hideRef.md │ │ │ │ ├── push.md │ │ │ │ ├── pushGlob.md │ │ │ │ ├── pushHead.md │ │ │ │ ├── pushRange.md │ │ │ │ ├── pushRef.md │ │ │ │ ├── reset.md │ │ │ │ ├── setSorting.md │ │ │ │ └── simplifyFirstParent.md │ │ ├── Signature │ │ │ └── createSignature.md │ │ ├── Tag │ │ │ ├── Methods │ │ │ │ ├── id.md │ │ │ │ ├── message.md │ │ │ │ ├── name.md │ │ │ │ ├── peel.md │ │ │ │ ├── tagger.md │ │ │ │ ├── target.md │ │ │ │ ├── targetId.md │ │ │ │ └── targetType.md │ │ │ └── isValidTagName.md │ │ └── Tree │ │ │ ├── Methods │ │ │ ├── asObject.md │ │ │ ├── get.md │ │ │ ├── getId.md │ │ │ ├── getName.md │ │ │ ├── getPath.md │ │ │ ├── id.md │ │ │ ├── isEmpty.md │ │ │ ├── iter.md │ │ │ ├── len.md │ │ │ └── walk.md │ │ │ └── TreeEntry │ │ │ ├── filemode.md │ │ │ ├── id.md │ │ │ ├── name.md │ │ │ ├── toObject.md │ │ │ └── type.md │ └── usage │ │ ├── commit.md │ │ ├── diff.md │ │ ├── history.md │ │ ├── remote.md │ │ ├── repository.md │ │ └── tag.md ├── package.json ├── performance.md ├── public │ ├── apple-touch-icon.png │ ├── favicon-96x96.png │ ├── favicon.ico │ ├── hero.webp │ ├── logo.png │ ├── og.png │ ├── site.webmanifest │ ├── web-app-manifest-192x192.png │ └── web-app-manifest-512x512.png ├── reference │ ├── Blob │ │ └── Methods │ │ │ ├── content.md │ │ │ ├── id.md │ │ │ ├── isBinary.md │ │ │ └── size.md │ ├── Branch │ │ ├── Methods │ │ │ ├── delete.md │ │ │ ├── findUpstream.md │ │ │ ├── getUpstream.md │ │ │ ├── isHead.md │ │ │ ├── name.md │ │ │ ├── referenceTarget.md │ │ │ ├── rename.md │ │ │ ├── setUpstream.md │ │ │ └── unsetUpstream.md │ │ └── isValidBranchName.md │ ├── Commit │ │ └── Methods │ │ │ ├── asObject.md │ │ │ ├── author.md │ │ │ ├── body.md │ │ │ ├── committer.md │ │ │ ├── id.md │ │ │ ├── message.md │ │ │ ├── summary.md │ │ │ ├── time.md │ │ │ └── tree.md │ ├── Diff │ │ ├── DiffDelta │ │ │ ├── flags.md │ │ │ ├── newFile.md │ │ │ ├── numFiles.md │ │ │ ├── oldFile.md │ │ │ └── status.md │ │ ├── DiffFile │ │ │ ├── exists.md │ │ │ ├── id.md │ │ │ ├── isBinary.md │ │ │ ├── isValidId.md │ │ │ ├── mode.md │ │ │ ├── path.md │ │ │ └── size.md │ │ ├── Methods │ │ │ ├── deltas.md │ │ │ ├── findSimilar.md │ │ │ ├── isSortedIcase.md │ │ │ ├── merge.md │ │ │ ├── print.md │ │ │ └── stats.md │ │ └── diffFlagsContains.md │ ├── GitObject │ │ └── Methods │ │ │ ├── asCommit.md │ │ │ ├── id.md │ │ │ ├── peel.md │ │ │ ├── peelToBlob.md │ │ │ ├── peelToCommit.md │ │ │ └── type.md │ ├── Index │ │ └── Methods │ │ │ ├── addAll.md │ │ │ ├── addPath.md │ │ │ ├── count.md │ │ │ ├── entries.md │ │ │ ├── getByPath.md │ │ │ ├── hasConflicts.md │ │ │ ├── isEmpty.md │ │ │ ├── path.md │ │ │ ├── read.md │ │ │ ├── removeAll.md │ │ │ ├── removePath.md │ │ │ ├── setVersion.md │ │ │ ├── updateAll.md │ │ │ ├── version.md │ │ │ ├── write.md │ │ │ └── writeTree.md │ ├── Oid │ │ ├── hashFileOid.md │ │ ├── hashObjectOid.md │ │ ├── isValidOid.md │ │ ├── isZeroOid.md │ │ └── zeroOid.md │ ├── Reference │ │ ├── Methods │ │ │ ├── delete.md │ │ │ ├── isBranch.md │ │ │ ├── isNote.md │ │ │ ├── isRemote.md │ │ │ ├── isTag.md │ │ │ ├── name.md │ │ │ ├── peelToTree.md │ │ │ ├── rename.md │ │ │ ├── resolve.md │ │ │ ├── shorthand.md │ │ │ ├── symbolicTarget.md │ │ │ ├── target.md │ │ │ ├── targetPeel.md │ │ │ └── type.md │ │ ├── isValidReferenceName.md │ │ └── normalizeReferenceName.md │ ├── Remote │ │ └── Methods │ │ │ ├── defaultBranch.md │ │ │ ├── fetch.md │ │ │ ├── name.md │ │ │ ├── prune.md │ │ │ ├── push.md │ │ │ ├── pushurl.md │ │ │ ├── refspecs.md │ │ │ └── url.md │ ├── Repository │ │ ├── Methods │ │ │ ├── addIgnoreRule.md │ │ │ ├── analyzeMerge.md │ │ │ ├── analyzeMergeForRef.md │ │ │ ├── blameFile.md │ │ │ ├── branches.md │ │ │ ├── checkoutHead.md │ │ │ ├── checkoutIndex.md │ │ │ ├── checkoutTree.md │ │ │ ├── cleanupState.md │ │ │ ├── clearIgnoreRules.md │ │ │ ├── commit.md │ │ │ ├── config.md │ │ │ ├── createAnnotationTag.md │ │ │ ├── createBranch.md │ │ │ ├── createLightweightTag.md │ │ │ ├── createRemote.md │ │ │ ├── createTag.md │ │ │ ├── deleteTag.md │ │ │ ├── diffIndexToIndex.md │ │ │ ├── diffIndexToWorkdir.md │ │ │ ├── diffTreeToTree.md │ │ │ ├── diffTreeToWorkdir.md │ │ │ ├── diffTreeToWorkdirWithIndex.md │ │ │ ├── extractSignature.md │ │ │ ├── findBranch.md │ │ │ ├── findCommit.md │ │ │ ├── findObject.md │ │ │ ├── findReference.md │ │ │ ├── findRemote.md │ │ │ ├── findStatusFile.md │ │ │ ├── findTag.md │ │ │ ├── findTree.md │ │ │ ├── getAnnotatedCommit.md │ │ │ ├── getAnnotatedCommitFromFetchHead.md │ │ │ ├── getAnnotatedCommitFromReference.md │ │ │ ├── getBranch.md │ │ │ ├── getCommit.md │ │ │ ├── getMergeBase.md │ │ │ ├── getMergeBaseMany.md │ │ │ ├── getMergeBaseOctopus.md │ │ │ ├── getMergeBases.md │ │ │ ├── getMergeBasesMany.md │ │ │ ├── getObject.md │ │ │ ├── getReference.md │ │ │ ├── getRemote.md │ │ │ ├── getStatusFile.md │ │ │ ├── getTag.md │ │ │ ├── getTree.md │ │ │ ├── head.md │ │ │ ├── headDetached.md │ │ │ ├── index.md │ │ │ ├── isBare.md │ │ │ ├── isEmpty.md │ │ │ ├── isPathIgnored.md │ │ │ ├── isShallow.md │ │ │ ├── isWorktree.md │ │ │ ├── mailmap.md │ │ │ ├── merge.md │ │ │ ├── mergeCommits.md │ │ │ ├── mergeTrees.md │ │ │ ├── path.md │ │ │ ├── remoteNames.md │ │ │ ├── revparse.md │ │ │ ├── revparseSingle.md │ │ │ ├── revwalk.md │ │ │ ├── setHead.md │ │ │ ├── setHeadDetached.md │ │ │ ├── setHeadDetachedFromAnnotated.md │ │ │ ├── state.md │ │ │ ├── statusShouldIgnore.md │ │ │ ├── statuses.md │ │ │ ├── tagForeach.md │ │ │ ├── tagNames.md │ │ │ └── workdir.md │ │ ├── cloneRepository.md │ │ ├── discoverRepository.md │ │ ├── initRepository.md │ │ └── openRepository.md │ ├── Revparse │ │ └── revparseModeContains.md │ ├── Revwalk │ │ └── Methods │ │ │ ├── hide.md │ │ │ ├── hideGlob.md │ │ │ ├── hideHead.md │ │ │ ├── hideRef.md │ │ │ ├── push.md │ │ │ ├── pushGlob.md │ │ │ ├── pushHead.md │ │ │ ├── pushRange.md │ │ │ ├── pushRef.md │ │ │ ├── reset.md │ │ │ ├── setSorting.md │ │ │ └── simplifyFirstParent.md │ ├── Signature │ │ └── createSignature.md │ ├── Tag │ │ ├── Methods │ │ │ ├── id.md │ │ │ ├── message.md │ │ │ ├── name.md │ │ │ ├── peel.md │ │ │ ├── tagger.md │ │ │ ├── target.md │ │ │ ├── targetId.md │ │ │ └── targetType.md │ │ └── isValidTagName.md │ └── Tree │ │ ├── Methods │ │ ├── asObject.md │ │ ├── get.md │ │ ├── getId.md │ │ ├── getName.md │ │ ├── getPath.md │ │ ├── id.md │ │ ├── isEmpty.md │ │ ├── iter.md │ │ ├── len.md │ │ └── walk.md │ │ └── TreeEntry │ │ ├── filemode.md │ │ ├── id.md │ │ ├── name.md │ │ ├── toObject.md │ │ └── type.md ├── tsconfig.json └── usage │ ├── commit.md │ ├── diff.md │ ├── history.md │ ├── remote.md │ ├── repository.md │ └── tag.md ├── index.d.ts ├── index.js ├── justfile ├── package.json ├── rustfmt.toml ├── src ├── annotated_commit.rs ├── blame.rs ├── blob.rs ├── branch.rs ├── checkout.rs ├── commit.rs ├── config.rs ├── diff.rs ├── error.rs ├── ignore.rs ├── index.rs ├── lib.rs ├── mailmap.rs ├── merge.rs ├── object.rs ├── oid.rs ├── reference.rs ├── remote.rs ├── repository.rs ├── revparse.rs ├── revwalk.rs ├── signature.rs ├── status.rs ├── tag.rs ├── tree.rs └── util.rs ├── taplo.toml ├── tests ├── annotated-commit.spec.ts ├── blame.spec.ts ├── blob.spec.ts ├── branch.spec.ts ├── checkout.spec.ts ├── commit.spec.ts ├── config.spec.ts ├── diff.spec.ts ├── env.ts ├── fixtures.ts ├── fixtures │ ├── blame │ │ ├── _git │ │ │ ├── COMMIT_EDITMSG │ │ │ ├── HEAD │ │ │ ├── config │ │ │ ├── description │ │ │ ├── index │ │ │ ├── info │ │ │ │ └── exclude │ │ │ ├── objects │ │ │ │ ├── 29 │ │ │ │ │ └── 8c79802351105fb1090e9e58709dc293807284 │ │ │ │ ├── 31 │ │ │ │ │ └── 592cf12bf62547f7650d494a21ef13ec948726 │ │ │ │ ├── 51 │ │ │ │ │ └── 029f41467b9e0da8eead9fd315936b29372ec5 │ │ │ │ ├── 57 │ │ │ │ │ └── 2d5d94839464f28ef959932515ee6624dbfe01 │ │ │ │ ├── 78 │ │ │ │ │ └── 533417a7d9664edc748a5ebfe4e4597a04b102 │ │ │ │ ├── 1e │ │ │ │ │ └── ff732219cdb670957086ef0a9ce3b5dfb3e5ed │ │ │ │ ├── 4e │ │ │ │ │ └── 923a297834ac3ebcb053955dfa0ba1488a2762 │ │ │ │ ├── 6a │ │ │ │ │ └── 8003da91eb8b81eda9fa60829281f40dfdb895 │ │ │ │ ├── 7d │ │ │ │ │ └── 65b5023dd21f6b6a280c92471f0bfcc9205854 │ │ │ │ ├── a1 │ │ │ │ │ └── ac638d28a809a53771fb4508fc955c850a6563 │ │ │ │ ├── a4 │ │ │ │ │ ├── 187e439680498bd49c7d1623b345853b315d24 │ │ │ │ │ └── 835a824b0e13a5d8e6c3fc2efe11b19db2f572 │ │ │ │ ├── bf │ │ │ │ │ └── 919193432351369043c79546ebef2f2c0ae88c │ │ │ │ ├── d6 │ │ │ │ │ └── d06d4a464c95a883224920131051f9c6958a22 │ │ │ │ ├── e4 │ │ │ │ │ └── ef0685ef71b4a7902b17bc1e2386413520af52 │ │ │ │ ├── e6 │ │ │ │ │ └── 9de29bb2d1d6434b8b29ae775ad8c2e48c5391 │ │ │ │ ├── f5 │ │ │ │ │ └── 001ea2983a7aef4f79b515e4886b493bdf6894 │ │ │ │ └── fa │ │ │ │ │ └── 9312f17690054007c8325ebdd402163fac01dd │ │ │ └── refs │ │ │ │ └── heads │ │ │ │ └── master │ │ ├── binary_file │ │ ├── blame │ │ └── empty_file │ ├── commits │ │ ├── _git │ │ │ ├── COMMIT_EDITMSG │ │ │ ├── HEAD │ │ │ ├── config │ │ │ ├── description │ │ │ ├── index │ │ │ ├── info │ │ │ │ └── exclude │ │ │ ├── objects │ │ │ │ ├── 88 │ │ │ │ │ └── 7efe1f5b0db9f180f98ad6958ee2e0aee198c1 │ │ │ │ ├── 9c │ │ │ │ │ └── 59e24b8393179a5d712de4f990178df5734d99 │ │ │ │ ├── a0 │ │ │ │ │ └── 1e9888e46729ef4aa68953ba19b02a7a64eb82 │ │ │ │ ├── b3 │ │ │ │ │ └── 3e0101b828225f77eeff4dfa31259dcf379002 │ │ │ │ ├── d0 │ │ │ │ │ └── 50db98b2b6674b8d65d73dde50e6e52c2c319d │ │ │ │ └── e0 │ │ │ │ │ └── 19be006cf33489e2d0177a3837a2384eddebc5 │ │ │ └── refs │ │ │ │ └── heads │ │ │ │ └── main │ │ ├── first │ │ └── second │ ├── diff │ │ ├── A │ │ ├── B │ │ ├── C │ │ └── _git │ │ │ ├── COMMIT_EDITMSG │ │ │ ├── HEAD │ │ │ ├── config │ │ │ ├── description │ │ │ ├── hooks │ │ │ ├── applypatch-msg.sample │ │ │ ├── commit-msg.sample │ │ │ ├── fsmonitor-watchman.sample │ │ │ ├── post-update.sample │ │ │ ├── pre-applypatch.sample │ │ │ ├── pre-commit.sample │ │ │ ├── pre-merge-commit.sample │ │ │ ├── pre-push.sample │ │ │ ├── pre-rebase.sample │ │ │ ├── pre-receive.sample │ │ │ ├── prepare-commit-msg.sample │ │ │ ├── push-to-checkout.sample │ │ │ └── update.sample │ │ │ ├── index │ │ │ ├── info │ │ │ └── exclude │ │ │ ├── objects │ │ │ ├── 22 │ │ │ │ └── 3b7836fb19fdf64ba2d3cd6173c6a283141f78 │ │ │ ├── 46 │ │ │ │ └── 93c6b85469102ed0174757f42d9c8806c687fb │ │ │ ├── 04 │ │ │ │ └── de102240808ce1c40275c24da02ce57ccf5a41 │ │ │ ├── 08 │ │ │ │ └── d22387db701fecc810c2f64828f93fedcf5c3e │ │ │ ├── 1d │ │ │ │ └── 58c101b252a96865788a0749114f537cd96a05 │ │ │ ├── 3c │ │ │ │ └── c58df83752123644fef39faab2393af643b1d2 │ │ │ ├── da │ │ │ │ └── 459f1d2a9b6bd95530d74c707954b757288479 │ │ │ ├── f5 │ │ │ │ └── 3c91092dbda83f3565e78c285f3e2ab0cfd968 │ │ │ └── f7 │ │ │ │ └── 0f10e4db19068f79bc43844b49f3eece45c4e8 │ │ │ └── refs │ │ │ └── heads │ │ │ └── main │ ├── empty │ │ └── _git │ │ │ ├── COMMIT_EDITMSG │ │ │ ├── HEAD │ │ │ ├── config │ │ │ ├── description │ │ │ ├── index │ │ │ ├── info │ │ │ └── exclude │ │ │ ├── objects │ │ │ ├── 69 │ │ │ │ └── 28d1d00de602d8ba53603574237ab499467c29 │ │ │ └── 4b │ │ │ │ └── 825dc642cb6eb9a060e54bf8d69288fbee4904 │ │ │ └── refs │ │ │ └── heads │ │ │ └── main │ ├── mailmap │ │ ├── .mailmap │ │ └── _git │ │ │ ├── COMMIT_EDITMSG │ │ │ ├── FETCH_HEAD │ │ │ ├── HEAD │ │ │ ├── config │ │ │ ├── description │ │ │ ├── index │ │ │ ├── info │ │ │ └── exclude │ │ │ ├── objects │ │ │ ├── 19 │ │ │ │ └── 9c187284140bcbbc349b06929cc3b353f393a5 │ │ │ ├── 31 │ │ │ │ └── c3baad252081eabdbbcc92d0a143db6b5b545a │ │ │ ├── 50 │ │ │ │ └── e6b05d9c524a8f37dda88cd8a1b6502f0e3f2a │ │ │ ├── 4c │ │ │ │ └── 276ac01f35c6bdc471ad6936e5f361934b1994 │ │ │ ├── c5 │ │ │ │ └── 9a21bfce35ee0016a4cd87feb96ed326d271af │ │ │ ├── d5 │ │ │ │ └── 2a2440dfd44f7b541c3811b10789537efe94af │ │ │ └── d9 │ │ │ │ └── 21dc0ceae0d1f011600ea92c1bfd1f21ae16a6 │ │ │ └── refs │ │ │ └── heads │ │ │ └── main │ ├── notgit │ │ └── .gitkeep │ ├── revparse │ │ └── _git │ │ │ ├── COMMIT_EDITMSG │ │ │ ├── HEAD │ │ │ ├── config │ │ │ ├── description │ │ │ ├── index │ │ │ ├── info │ │ │ └── exclude │ │ │ ├── objects │ │ │ ├── 60 │ │ │ │ └── 10700f61fe03e4bdf3814fa9ba2cdbcea0ddec │ │ │ ├── 4b │ │ │ │ └── 825dc642cb6eb9a060e54bf8d69288fbee4904 │ │ │ ├── a5 │ │ │ │ └── fd9e1400af677d54a665dee953c7bde1daaaab │ │ │ ├── b5 │ │ │ │ └── 80e5f5030f508a3658a4155f44cdd9754950c5 │ │ │ └── ec │ │ │ │ └── ec200b27c181b64545bd03f99e995768289d4f │ │ │ └── refs │ │ │ └── heads │ │ │ ├── main │ │ │ └── other │ └── tag │ │ ├── A │ │ ├── B │ │ ├── C │ │ └── _git │ │ ├── COMMIT_EDITMSG │ │ ├── HEAD │ │ ├── config │ │ ├── description │ │ ├── hooks │ │ ├── applypatch-msg.sample │ │ ├── commit-msg.sample │ │ ├── fsmonitor-watchman.sample │ │ ├── post-update.sample │ │ ├── pre-applypatch.sample │ │ ├── pre-commit.sample │ │ ├── pre-merge-commit.sample │ │ ├── pre-push.sample │ │ ├── pre-rebase.sample │ │ ├── pre-receive.sample │ │ ├── prepare-commit-msg.sample │ │ ├── push-to-checkout.sample │ │ └── update.sample │ │ ├── index │ │ ├── info │ │ └── exclude │ │ ├── objects │ │ ├── 22 │ │ │ └── 3b7836fb19fdf64ba2d3cd6173c6a283141f78 │ │ ├── 26 │ │ │ └── cf7ebc61494e892188a3ceab38702b2ecdc353 │ │ ├── 41 │ │ │ └── 1412e7676a1249e429b34d4f3ab1229b3d5e8e │ │ ├── 56 │ │ │ └── 7aa5c6b219312dc7758ab88ebb7a1e5d36d26b │ │ ├── 67 │ │ │ └── 4e3327707fcf32a348ecfc0cb6b93e57398b8c │ │ ├── 82 │ │ │ └── 8954df9f08dc8e172447cdacf0ddea1adf9e63 │ │ ├── 04 │ │ │ └── de102240808ce1c40275c24da02ce57ccf5a41 │ │ ├── 1d │ │ │ └── 58c101b252a96865788a0749114f537cd96a05 │ │ ├── 3c │ │ │ └── c58df83752123644fef39faab2393af643b1d2 │ │ ├── aa │ │ │ └── 0040546ed22b8bb33f3bd621e8d10ed849b02c │ │ ├── f5 │ │ │ └── 3c91092dbda83f3565e78c285f3e2ab0cfd968 │ │ └── f7 │ │ │ └── 0f10e4db19068f79bc43844b49f3eece45c4e8 │ │ └── refs │ │ ├── heads │ │ └── main │ │ └── tags │ │ ├── v0 │ │ ├── v1 │ │ └── v2 ├── ignore.spec.ts ├── index.spec.ts ├── mailmap.spec.ts ├── merge.spec.ts ├── object.spec.ts ├── oid.spec.ts ├── reference.spec.ts ├── remote.spec.ts ├── repository.spec.ts ├── revparse.spec.ts ├── revwalk.spec.ts ├── signature.spec.ts ├── status.spec.ts ├── tag.spec.ts ├── tmp.ts ├── tree.spec.ts └── types.ts ├── transforms └── dts.mjs ├── tsconfig.json ├── vercel.json ├── vitest.config.mts └── yarn.lock /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [target.aarch64-unknown-linux-musl] 2 | linker = "aarch64-linux-musl-gcc" 3 | rustflags = ["-C", "target-feature=-crt-static"] 4 | 5 | [target.x86_64-pc-windows-msvc] 6 | rustflags = ["-C", "target-feature=+crt-static"] 7 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | /.yarn/** linguist-vendored 2 | /.yarn/releases/* binary 3 | /index.js linguist-generated=true text=auto eol=lf 4 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @seokju-na -------------------------------------------------------------------------------- /.node-version: -------------------------------------------------------------------------------- 1 | 22.14.0 2 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | target 2 | Cargo.lock 3 | .cargo 4 | .github 5 | npm 6 | .eslintrc 7 | .prettierignore 8 | rustfmt.toml 9 | yarn.lock 10 | *.node 11 | .yarn 12 | __test__ 13 | renovate.json 14 | -------------------------------------------------------------------------------- /.scripts/prepare-next-release.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S node --no-warnings=ExperimentalWarning --experimental-strip-types 2 | import fs from 'node:fs/promises'; 3 | import { EOL } from 'node:os'; 4 | import path from 'node:path'; 5 | import { fileURLToPath } from 'node:url'; 6 | 7 | const dirname = path.dirname(fileURLToPath(import.meta.url)); 8 | const rootdir = path.join(dirname, '..'); 9 | 10 | const [, , build, commit] = process.argv; 11 | if (build == null || commit == null) { 12 | throw new Error('Invalid build/commit info'); 13 | } 14 | 15 | const pkgFilepath = path.join(rootdir, 'package.json'); 16 | const pkg = JSON.parse(await fs.readFile(pkgFilepath, 'utf8')); 17 | pkg.version = `${pkg.version}-next.${build}+${commit.slice(0, 7)}`; 18 | 19 | await fs.writeFile(pkgFilepath, `${JSON.stringify(pkg, null, 2)}${EOL}`, 'utf8'); 20 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | enableGlobalCache: true 2 | 3 | httpRetry: 10 4 | 5 | nodeLinker: node-modules 6 | 7 | preferReuse: true 8 | 9 | yarnPath: .yarn/releases/yarn-4.9.1.cjs 10 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | edition = "2021" 3 | name = "es-git" 4 | version = "0.0.0" 5 | 6 | [lib] 7 | crate-type = ["cdylib"] 8 | 9 | [dependencies] 10 | bitflags = "2.1.0" 11 | chrono = "0.4" 12 | git2 = { version = "0.20.1", features = ["vendored-libgit2", "vendored-openssl"] } 13 | napi = { version = "2.16.17", default-features = false, features = ["napi6", "chrono_date"] } 14 | napi-derive = "2.16.13" 15 | thiserror = "2.0.3" 16 | 17 | [build-dependencies] 18 | napi-build = "2.1.6" 19 | 20 | [profile.release] 21 | lto = true 22 | -------------------------------------------------------------------------------- /benchmarks/nodegit/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@figma/nodegit'); 2 | -------------------------------------------------------------------------------- /benchmarks/nodegit/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nodegit", 3 | "main": "./index.js", 4 | "types": "./index.d.ts", 5 | "dependencies": { 6 | "@figma/nodegit": "0.28.0-figma.8" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /benchmarks/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "benchmarks", 3 | "private": true, 4 | "scripts": { 5 | "bench": "vitest bench --run" 6 | }, 7 | "dependencies": { 8 | "@napi-rs/simple-git": "0.1.19", 9 | "nodegit": "link:./nodegit" 10 | }, 11 | "devDependencies": { 12 | "@types/nodegit": "^0.28.7", 13 | "vitest": "^3.0.5" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /benchmarks/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json" 3 | } 4 | -------------------------------------------------------------------------------- /benchmarks/vitest.config.mts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | environment: 'node', 6 | }, 7 | }); 8 | -------------------------------------------------------------------------------- /build.rs: -------------------------------------------------------------------------------- 1 | extern crate napi_build; 2 | 3 | fn main() { 4 | napi_build::setup(); 5 | } 6 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | .vitepress/cache 2 | typedoc-generated/ 3 | typedoc-generated.json 4 | -------------------------------------------------------------------------------- /docs/.vitepress/config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitepress'; 2 | import { en } from './en'; 3 | import { ko } from './ko'; 4 | import { shared } from './shared'; 5 | 6 | export default defineConfig({ 7 | ...shared, 8 | locales: { 9 | root: { label: 'English', ...en }, 10 | ko: { label: '한국어', ...ko }, 11 | }, 12 | ignoreDeadLinks: [/\/index/], 13 | }); 14 | -------------------------------------------------------------------------------- /docs/.vitepress/theme/index.js: -------------------------------------------------------------------------------- 1 | import DefaultTheme from 'vitepress/theme'; 2 | import './index.css'; 3 | 4 | /** @type {import('vitepress').Theme} */ 5 | export default { 6 | extends: DefaultTheme, 7 | }; 8 | -------------------------------------------------------------------------------- /docs/gen/cli.ts: -------------------------------------------------------------------------------- 1 | import path from 'node:path'; 2 | import { fileURLToPath } from 'node:url'; 3 | import { Cli } from 'clipanion'; 4 | import dotenv from 'dotenv'; 5 | import { ReferenceCommand } from './commands/reference'; 6 | 7 | const dirname = path.dirname(fileURLToPath(import.meta.url)); 8 | dotenv.config({ path: path.join(dirname, '..', '.env') }); 9 | 10 | const [node, app, ...args] = process.argv; 11 | 12 | const cli = new Cli({ 13 | binaryLabel: 'documentation gen', 14 | binaryName: `${node} ${app}`, 15 | binaryVersion: '0.0.0', 16 | }); 17 | 18 | cli.register(ReferenceCommand); 19 | cli.runExit(args); 20 | -------------------------------------------------------------------------------- /docs/gen/fs.ts: -------------------------------------------------------------------------------- 1 | import fs from 'node:fs/promises'; 2 | import path from 'node:path'; 3 | 4 | let rootDir: string | null = null; 5 | 6 | export async function findRootDir(): Promise { 7 | if (rootDir != null) { 8 | return rootDir; 9 | } 10 | let current = process.cwd(); 11 | while (true) { 12 | if (current === '.') { 13 | throw new Error('Cannot find root directory.'); 14 | } 15 | const files = await fs.readdir(current); 16 | if (files.includes('yarn.lock')) { 17 | break; 18 | } 19 | current = path.resolve(current, '../'); 20 | } 21 | rootDir = current; 22 | return rootDir; 23 | } 24 | -------------------------------------------------------------------------------- /docs/gen/lang.ts: -------------------------------------------------------------------------------- 1 | import { Option } from 'clipanion'; 2 | import { isEnum } from 'typanion'; 3 | 4 | /** 5 | * For contributors translating to new languages, 6 | * please enter the ISO-639 code of the language you wish to add here. 7 | */ 8 | const LANGUAGES = ['en', 'ko'] as const; 9 | 10 | export type Language = (typeof LANGUAGES)[number]; 11 | 12 | export const LanguageOption = Option.String('-l,--lang', 'en', { 13 | description: 'Language to generate documentation', 14 | validator: isEnum(LANGUAGES), 15 | }); 16 | -------------------------------------------------------------------------------- /docs/gen/texts.ts: -------------------------------------------------------------------------------- 1 | import type { Language } from './lang'; 2 | 3 | const texts = { 4 | signature: { 5 | en: 'Signature', 6 | ko: '시그니처', 7 | }, 8 | parameters: { 9 | en: 'Parameters', 10 | ko: '파라미터', 11 | }, 12 | returns: { 13 | en: 'Returns', 14 | ko: '반환 값', 15 | }, 16 | examples: { 17 | en: 'Examples', 18 | ko: '예제', 19 | }, 20 | required: { 21 | en: 'required', 22 | ko: '필수', 23 | }, 24 | default: { 25 | en: 'Default', 26 | ko: '기본값', 27 | }, 28 | errors: { 29 | en: 'Errors', 30 | ko: '에러', 31 | }, 32 | } as const; 33 | 34 | export function t(key: keyof typeof texts, lang: Language): string { 35 | return texts[key][lang]; 36 | } 37 | -------------------------------------------------------------------------------- /docs/gen/util.ts: -------------------------------------------------------------------------------- 1 | export function indent(text: string, size = 2): string { 2 | const space = ' '.repeat(size); 3 | return text 4 | .split('\n') 5 | .map(line => `${space}${line}`) 6 | .join('\n'); 7 | } 8 | -------------------------------------------------------------------------------- /docs/ko/reference/Blob/Methods/content.md: -------------------------------------------------------------------------------- 1 | # content 2 | 3 | 이 블롭의 내용을 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Blob { 9 | content(): Uint8Array; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Blob/Methods/id.md: -------------------------------------------------------------------------------- 1 | # id 2 | 3 | 리포지토리 블롭의 ID(SHA1 해시)를 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Blob { 9 | id(): string; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Blob/Methods/isBinary.md: -------------------------------------------------------------------------------- 1 | # isBinary 2 | 3 | 블롭의 내용이 바이너리 데이터인지 확인해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Blob { 9 | isBinary(): boolean; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Blob/Methods/size.md: -------------------------------------------------------------------------------- 1 | # size 2 | 3 | 이 블롭의 크기(바이트 단위)를 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Blob { 9 | size(): bigint; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Branch/Methods/delete.md: -------------------------------------------------------------------------------- 1 | # delete 2 | 3 | 기존 브랜치 참조를 삭제해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Branch { 9 | delete(): void; 10 | } 11 | ``` -------------------------------------------------------------------------------- /docs/ko/reference/Branch/Methods/findUpstream.md: -------------------------------------------------------------------------------- 1 | # findUpstream 2 | 3 | 해당 브랜치의 업스트림을 조회해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Branch { 9 | findUpstream(): Branch | null; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Branch/Methods/getUpstream.md: -------------------------------------------------------------------------------- 1 | # getUpstream 2 | 3 | 해당 브랜치의 업스트림을 조회해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Branch { 9 | getUpstream(): Branch; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | 22 | 23 | ### 에러 24 | 25 | -------------------------------------------------------------------------------- /docs/ko/reference/Branch/Methods/isHead.md: -------------------------------------------------------------------------------- 1 | # isHead 2 | 3 | 현재 로컬 브랜치가 `HEAD`에 의해 가리켜져 있는지 판단해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Branch { 9 | isHead(): boolean; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Branch/Methods/name.md: -------------------------------------------------------------------------------- 1 | # name 2 | 3 | 주어진 로컬 또는 원격 브랜치의 이름을 반환해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Branch { 9 | name(): string; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | 22 | 23 | ### 에러 24 | 25 | -------------------------------------------------------------------------------- /docs/ko/reference/Branch/Methods/referenceTarget.md: -------------------------------------------------------------------------------- 1 | # referenceTarget 2 | 3 | 이 브랜치의 참조가 가리키는 OID를 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Branch { 9 | referenceTarget(): string | null; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Branch/Methods/setUpstream.md: -------------------------------------------------------------------------------- 1 | # setUpstream 2 | 3 | 업스트림을 설정해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Branch { 9 | setUpstream(upstreamName: string): void; 10 | } 11 | ``` 12 | 13 | ### 파라미터 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Branch/Methods/unsetUpstream.md: -------------------------------------------------------------------------------- 1 | # unsetUpstream 2 | 3 | 업스트림을 해제해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Branch { 9 | unsetUpstream(): void; 10 | } 11 | ``` -------------------------------------------------------------------------------- /docs/ko/reference/Branch/isValidBranchName.md: -------------------------------------------------------------------------------- 1 | # isValidBranchName 2 | 3 | 브랜치 이름이 유효한지 확인해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | function isValidBranchName(name: string): boolean; 9 | ``` 10 | 11 | ### 파라미터 12 | 13 | 20 | 21 | ### 반환 값 22 | 23 | -------------------------------------------------------------------------------- /docs/ko/reference/Commit/Methods/asObject.md: -------------------------------------------------------------------------------- 1 | # asObject 2 | 3 | 이 Commit을 `GitObject`로 사용할 수 있도록 캐스팅해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Commit { 9 | asObject(): GitObject; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Commit/Methods/body.md: -------------------------------------------------------------------------------- 1 | # body 2 | 3 | git 커밋 메시지의 긴 "본문"을 가져와요. 4 | 5 | 반환되는 메시지는 커밋의 본문으로, 메시지의 첫 번째 단락을 제외한 모든 내용을 포함하며, 선행 및 후행 공백이 제거돼요. 6 | 7 | ## 시그니처 8 | 9 | ```ts 10 | class Commit { 11 | body(): string | null; 12 | } 13 | ``` 14 | 15 | ### 반환 값 16 | 17 | 24 | 25 | ### 에러 26 | 27 | 34 | -------------------------------------------------------------------------------- /docs/ko/reference/Commit/Methods/id.md: -------------------------------------------------------------------------------- 1 | # id 2 | 3 | 리포지토리 커밋의 ID(SHA1)를 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Commit { 9 | id(): string; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Commit/Methods/message.md: -------------------------------------------------------------------------------- 1 | # message 2 | 3 | 커밋의 전체 메시지를 가져와요. 4 | 5 | 반환되는 메시지는 잠재적인 선행 개행을 제거하여 약간 다듬어진 형태로 제공돼요. 6 | 7 | ## 시그니처 8 | 9 | ```ts 10 | class Commit { 11 | message(): string; 12 | } 13 | ``` 14 | 15 | ### 반환 값 16 | 17 | 24 | 25 | ### 에러 26 | 27 | -------------------------------------------------------------------------------- /docs/ko/reference/Commit/Methods/summary.md: -------------------------------------------------------------------------------- 1 | # summary 2 | 3 | git 커밋 메시지의 간단한 "요약"을 가져와요. 4 | 5 | 반환되는 메시지는 커밋의 요약으로, 메시지의 첫 번째 단락을 공백을 제거하고 합친 형태로 제공돼요. 6 | 7 | ## 시그니처 8 | 9 | ```ts 10 | class Commit { 11 | summary(): string | null; 12 | } 13 | ``` 14 | 15 | ### 반환 값 16 | 17 | 24 | 25 | ### 에러 26 | 27 | 34 | -------------------------------------------------------------------------------- /docs/ko/reference/Commit/Methods/time.md: -------------------------------------------------------------------------------- 1 | # time 2 | 3 | 커밋 시각(즉, 커미터의 시각)을 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Commit { 9 | time(): Date; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Commit/Methods/tree.md: -------------------------------------------------------------------------------- 1 | # tree 2 | 3 | 커밋이 가리키는 트리를 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Commit { 9 | tree(): Tree; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Diff/DiffDelta/flags.md: -------------------------------------------------------------------------------- 1 | # flags 2 | 3 | ## 시그니처 4 | 5 | ```ts 6 | class DiffDelta { 7 | flags(): number; 8 | } 9 | ``` 10 | 11 | ### 반환 값 12 | 13 | 20 | 21 | ## 예제 22 | 23 | ```ts 24 | import { DiffDelta, DiffFlags, diffFlagsContains } from 'es-git'; 25 | 26 | const delta: DiffDelta; 27 | console.assert(diffFlagsContains(delta.flags(), DiffFlags.Binary | DiffFlags.ValidId)); 28 | ``` 29 | -------------------------------------------------------------------------------- /docs/ko/reference/Diff/DiffDelta/newFile.md: -------------------------------------------------------------------------------- 1 | # newFile 2 | 3 | Diff에서 "to" 쪽을 나타내는 파일을 반환해요. 4 | 5 | 어느 쪽을 의미하는지는 diff를 생성하는 데 사용된 함수에 따라 달라지며, 해당 함수 자체의 문서에서 설명돼 있어요. 6 | 7 | ## 시그니처 8 | 9 | ```ts 10 | class DiffDelta { 11 | newFile(): DiffFile; 12 | } 13 | ``` 14 | 15 | ### 반환 값 16 | 17 | -------------------------------------------------------------------------------- /docs/ko/reference/Diff/DiffDelta/numFiles.md: -------------------------------------------------------------------------------- 1 | # numFiles 2 | 3 | 이 Delta에 포함된 파일의 수를 반환해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class DiffDelta { 9 | numFiles(): number; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Diff/DiffDelta/oldFile.md: -------------------------------------------------------------------------------- 1 | # oldFile 2 | 3 | Diff에서 "from" 쪽을 나타내는 파일을 반환해요. 4 | 5 | 어느 쪽을 의미하는지는 diff를 생성하는 데 사용된 함수에 따라 달라지며, 해당 함수 자체의 문서에서 설명돼 있어요. 6 | 7 | ## 시그니처 8 | 9 | ```ts 10 | class DiffDelta { 11 | oldFile(): DiffFile; 12 | } 13 | ``` 14 | 15 | ### 반환 값 16 | 17 | -------------------------------------------------------------------------------- /docs/ko/reference/Diff/DiffFile/exists.md: -------------------------------------------------------------------------------- 1 | # exists 2 | 3 | 해당 쪽의 파일이 존재하면 `true`를 반환해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class DiffFile { 9 | exists(): boolean; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Diff/DiffFile/id.md: -------------------------------------------------------------------------------- 1 | # id 2 | 3 | 해당 항목의 Oid를 반환해요. 4 | 5 | 만약 이 항목이 diff의 존재하지 않는 쪽을 나타낸다면 (예: `Added` delta의 `oldFile`), 반환되는 oid는 0으로 채워져 있어요. 6 | 7 | ## 시그니처 8 | 9 | ```ts 10 | class DiffFile { 11 | id(): string; 12 | } 13 | ``` 14 | 15 | ### 반환 값 16 | 17 | -------------------------------------------------------------------------------- /docs/ko/reference/Diff/DiffFile/isBinary.md: -------------------------------------------------------------------------------- 1 | # isBinary 2 | 3 | ## 시그니처 4 | 5 | ```ts 6 | class DiffFile { 7 | isBinary(): boolean; 8 | } 9 | ``` 10 | 11 | ### 반환 값 12 | 13 | -------------------------------------------------------------------------------- /docs/ko/reference/Diff/DiffFile/isValidId.md: -------------------------------------------------------------------------------- 1 | # isValidId 2 | 3 | ## 시그니처 4 | 5 | ```ts 6 | class DiffFile { 7 | isValidId(): boolean; 8 | } 9 | ``` 10 | 11 | ### 반환 값 12 | 13 | -------------------------------------------------------------------------------- /docs/ko/reference/Diff/DiffFile/mode.md: -------------------------------------------------------------------------------- 1 | # mode 2 | 3 | ## 시그니처 4 | 5 | ```ts 6 | class DiffFile { 7 | mode(): FileMode; 8 | } 9 | ``` 10 | 11 | ### 반환 값 12 | 13 | -------------------------------------------------------------------------------- /docs/ko/reference/Diff/DiffFile/path.md: -------------------------------------------------------------------------------- 1 | # path 2 | 3 | ## 시그니처 4 | 5 | ```ts 6 | class DiffFile { 7 | path(): string | null; 8 | } 9 | ``` 10 | 11 | ### 반환 값 12 | 13 | -------------------------------------------------------------------------------- /docs/ko/reference/Diff/DiffFile/size.md: -------------------------------------------------------------------------------- 1 | # size 2 | 3 | ## 시그니처 4 | 5 | ```ts 6 | class DiffFile { 7 | size(): bigint; 8 | } 9 | ``` 10 | 11 | ### 반환 값 12 | 13 | -------------------------------------------------------------------------------- /docs/ko/reference/Diff/Methods/deltas.md: -------------------------------------------------------------------------------- 1 | # deltas 2 | 3 | ## 시그니처 4 | 5 | ```ts 6 | class Diff { 7 | deltas(): Deltas; 8 | } 9 | ``` 10 | 11 | ### 반환 값 12 | 13 | -------------------------------------------------------------------------------- /docs/ko/reference/Diff/Methods/isSortedIcase.md: -------------------------------------------------------------------------------- 1 | # isSortedIcase 2 | 3 | Delta들이 대소문자 구분 또는 무시하여 정렬되었는지 확인해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Diff { 9 | isSortedIcase(): boolean; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Diff/Methods/merge.md: -------------------------------------------------------------------------------- 1 | # merge 2 | 3 | 하나의 diff를 다른 diff에 병합해요. 4 | 5 | 이 메소드는 "from" 리스트의 항목들을 "self" 리스트에 병합해, 두 리스트 중 어느 한쪽에 나타나는 모든 항목들이 포함된 결과 diff를 만들어요. 6 | 만약 항목이 두 리스트 모두에 존재한다면, 해당 항목은 "onto" 리스트의 구버전과 "from" 리스트의 신버전이 병합된 것처럼 나타나요 7 | (단, 해당 항목에 중간에 대기 중인 DELETE가 있으면 삭제된 것으로 표시돼요). 8 | 9 | ## 시그니처 10 | 11 | ```ts 12 | class Diff { 13 | merge(diff: Diff): void; 14 | } 15 | ``` 16 | 17 | ### 파라미터 18 | 19 | -------------------------------------------------------------------------------- /docs/ko/reference/Diff/Methods/stats.md: -------------------------------------------------------------------------------- 1 | # stats 2 | 3 | 모든 패치에 대한 diff 통계 정보를 집계해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Diff { 9 | stats(): DiffStats; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/GitObject/Methods/asCommit.md: -------------------------------------------------------------------------------- 1 | # asCommit 2 | 3 | 이 개체를 커밋으로 간주하려고 시도해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class GitObject { 9 | asCommit(): Commit | null; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/GitObject/Methods/id.md: -------------------------------------------------------------------------------- 1 | # id 2 | 3 | 리포지토리 개체의 id (SHA1)를 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class GitObject { 9 | id(): string; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/GitObject/Methods/peelToBlob.md: -------------------------------------------------------------------------------- 1 | # peelToBlob 2 | 3 | 블롭이 나올 때까지 재귀적으로 개체를 풀어요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class GitObject { 9 | peelToBlob(): Blob; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/GitObject/Methods/peelToCommit.md: -------------------------------------------------------------------------------- 1 | # peelToCommit 2 | 3 | 커밋이 나올 때까지 재귀적으로 개체를 풀어요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class GitObject { 9 | peelToCommit(): Commit; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/GitObject/Methods/type.md: -------------------------------------------------------------------------------- 1 | # type 2 | 3 | 개체의 타입을 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class GitObject { 9 | type(): ObjectType | null; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Index/Methods/count.md: -------------------------------------------------------------------------------- 1 | # count 2 | 3 | 현재 인덱스에 있는 항목들의 개수를 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Index { 9 | count(): number; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Index/Methods/entries.md: -------------------------------------------------------------------------------- 1 | # entries 2 | 3 | 이 인덱스에 있는 항목들을 순회할 수 있는 iterator를 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Index { 9 | entries(): IndexEntries; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Index/Methods/hasConflicts.md: -------------------------------------------------------------------------------- 1 | # hasConflicts 2 | 3 | 이 인덱스에 충돌이 있는지 확인해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Index { 9 | hasConflicts(): boolean; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Index/Methods/isEmpty.md: -------------------------------------------------------------------------------- 1 | # isEmpty 2 | 3 | ## 시그니처 4 | 5 | ```ts 6 | class Index { 7 | isEmpty(): boolean; 8 | } 9 | ``` 10 | 11 | ### 반환 값 12 | 13 | -------------------------------------------------------------------------------- /docs/ko/reference/Index/Methods/path.md: -------------------------------------------------------------------------------- 1 | # path 2 | 3 | 디스크상의 인덱스 파일 전체 경로를 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Index { 9 | path(): string | null; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Index/Methods/read.md: -------------------------------------------------------------------------------- 1 | # read 2 | 3 | 하드 디스크에서 읽어 메모리 내에 존재하는 인덱스 개체의 내용을 업데이트해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Index { 9 | read(force?: boolean | null | undefined): void; 10 | } 11 | ``` 12 | 13 | ### 파라미터 14 | 15 | 22 | -------------------------------------------------------------------------------- /docs/ko/reference/Index/Methods/setVersion.md: -------------------------------------------------------------------------------- 1 | # setVersion 2 | 3 | 디스크에 기록된 인덱스 버전을 설정해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Index { 9 | setVersion(version: number): void; 10 | } 11 | ``` 12 | 13 | ### 파라미터 14 | 15 | 22 | -------------------------------------------------------------------------------- /docs/ko/reference/Index/Methods/version.md: -------------------------------------------------------------------------------- 1 | # version 2 | 3 | 디스크에 기록된 인데스 버전을 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Index { 9 | version(): number; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Index/Methods/write.md: -------------------------------------------------------------------------------- 1 | # write 2 | 3 | 메모리 내의 기존 인덱스 개체를 원자적 파일 잠금을 사용하여 디스크에 다시 기록해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Index { 9 | write(): void; 10 | } 11 | ``` -------------------------------------------------------------------------------- /docs/ko/reference/Index/Methods/writeTree.md: -------------------------------------------------------------------------------- 1 | # writeTree 2 | 3 | 인덱스를 트리 형태로 기록해요. 4 | 5 | 이 메소드는 인덱스를 검색하여 현재 상태를 디스크에 기록해요; 인덱스에 저장된 각 서브트리에 대해 재귀적으로 트리 개체를 생성하지만, 최종적으로는 루트 트리의 OID만 반환해요. 이 OID는 예를 들어 커밋을 생성할 때 사용될 수 있어요. 6 | 7 | 인덱스 인스턴스는 bare이면 안 되며, 기존 리포지토리와 연결되어 있어야 해요. 8 | 9 | 인덱스에는 충돌 상태인 파일이 없어야 해요. 10 | 11 | ## 시그니처 12 | 13 | ```ts 14 | class Index { 15 | writeTree(): string; 16 | } 17 | ``` 18 | -------------------------------------------------------------------------------- /docs/ko/reference/Oid/isValidOid.md: -------------------------------------------------------------------------------- 1 | # isValidOid 2 | 3 | 주어진 문자열이 유효한 OID(Object ID)인지 확인해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | function isValidOid(value: string): boolean; 9 | ``` 10 | 11 | ### 파라미터 12 | 13 | 20 | 21 | ### 반환 값 22 | 23 | -------------------------------------------------------------------------------- /docs/ko/reference/Oid/zeroOid.md: -------------------------------------------------------------------------------- 1 | # zeroOid 2 | 3 | 모두 0으로 이루어진 OID(Object ID) 문자열을 생성해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | function zeroOid(): string; 9 | ``` 10 | 11 | ### 반환 값 12 | 13 | -------------------------------------------------------------------------------- /docs/ko/reference/Reference/Methods/delete.md: -------------------------------------------------------------------------------- 1 | # delete 2 | 3 | 레퍼런스를 삭제해요. 4 | 5 | 이 메서드는 직접 레퍼런스(direct reference)와 심볼릭 레퍼런스(symbolic reference) 모두에서 작동하며, 6 | 레퍼런스는 즉시 디스크에서 제거돼요. 7 | 8 | ## 시그니처 9 | 10 | ```ts 11 | class Reference { 12 | delete(): void; 13 | } 14 | ``` 15 | 16 | ### 에러 17 | 18 | -------------------------------------------------------------------------------- /docs/ko/reference/Reference/Methods/isBranch.md: -------------------------------------------------------------------------------- 1 | # isBranch 2 | 3 | 레퍼런스가 로컬 브랜치인지 확인해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Reference { 9 | isBranch(): boolean; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Reference/Methods/isNote.md: -------------------------------------------------------------------------------- 1 | # isNote 2 | 3 | 레퍼런스가 노트인지 확인해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Reference { 9 | isNote(): boolean; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Reference/Methods/isRemote.md: -------------------------------------------------------------------------------- 1 | # isRemote 2 | 3 | 레퍼런스가 리모트 추적 브랜치(remote tracking branch)인지 확인해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Reference { 9 | isRemote(): boolean; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Reference/Methods/isTag.md: -------------------------------------------------------------------------------- 1 | # isTag 2 | 3 | 레퍼런스가 태그인지 확인해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Reference { 9 | isTag(): boolean; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Reference/Methods/name.md: -------------------------------------------------------------------------------- 1 | # name 2 | 3 | 레퍼런스의 전체 이름을 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Reference { 9 | name(): string; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | 22 | 23 | ### 에러 24 | 25 | -------------------------------------------------------------------------------- /docs/ko/reference/Reference/Methods/peelToTree.md: -------------------------------------------------------------------------------- 1 | # peelToTree 2 | 3 | 레퍼런스를 트리까지 재귀적으로 펼쳐요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Reference { 9 | peelToTree(): Tree; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Reference/Methods/resolve.md: -------------------------------------------------------------------------------- 1 | # resolve 2 | 3 | 심볼릭 레퍼런스를 직접 레퍼런스로 변환해요. 4 | 5 | 이 메서드는 심볼릭 레퍼런스를 반복적으로 펼쳐(OID가 가리키는 대상을 따라감) 6 | 직접 레퍼런스로 변환할 때까지 실행돼요. 7 | 8 | 만약 직접 레퍼런스를 인자로 전달하면, 해당 레퍼런스의 복사본을 반환해요. 9 | 10 | ## 시그니처 11 | 12 | ```ts 13 | class Reference { 14 | resolve(): Reference; 15 | } 16 | ``` 17 | 18 | ### 반환 값 19 | 20 | -------------------------------------------------------------------------------- /docs/ko/reference/Reference/Methods/shorthand.md: -------------------------------------------------------------------------------- 1 | # shorthand 2 | 3 | 레퍼런스의 축약된 이름을 가져와요. 4 | 5 | 이 메서드는 레퍼런스 이름을 사람이 읽기 쉬운 형태로 변환해요. 6 | 적절한 축약형이 없으면 전체 이름을 반환해요. 7 | 8 | ## 시그니처 9 | 10 | ```ts 11 | class Reference { 12 | shorthand(): string; 13 | } 14 | ``` 15 | 16 | ### 반환 값 17 | 18 | 25 | 26 | ### 에러 27 | 28 | -------------------------------------------------------------------------------- /docs/ko/reference/Reference/Methods/symbolicTarget.md: -------------------------------------------------------------------------------- 1 | # symbolicTarget 2 | 3 | 심볼릭 레퍼런스가 가리키는 레퍼런스의 전체 이름을 가져와요. 4 | 5 | 이 메서드는 레퍼런스가 심볼릭일 때만 사용할 수 있어요. 6 | 7 | ## 시그니처 8 | 9 | ```ts 10 | class Reference { 11 | symbolicTarget(): string | null; 12 | } 13 | ``` 14 | 15 | ### 반환 값 16 | 17 | -------------------------------------------------------------------------------- /docs/ko/reference/Reference/Methods/target.md: -------------------------------------------------------------------------------- 1 | # target 2 | 3 | 직접 레퍼런스가 가리키는 OID(Object ID)를 가져와요. 4 | 5 | 이 메서드는 직접 레퍼런스(개체 ID를 가리키는 레퍼런스)에서만 사용할 수 있어요. 6 | 심볼릭 레퍼런스에서는 사용할 수 없어요. 7 | 8 | 9 | ## 시그니처 10 | 11 | ```ts 12 | class Reference { 13 | target(): string | null; 14 | } 15 | ``` 16 | 17 | ### 반환 값 18 | 19 | -------------------------------------------------------------------------------- /docs/ko/reference/Reference/Methods/targetPeel.md: -------------------------------------------------------------------------------- 1 | # targetPeel 2 | 3 | 이 레퍼런스가 가리키는 OID(Object ID)를 펼쳐서 반환해요. 4 | 5 | 펼친 OID는 직접 레퍼런스 중에서도 특정 개체(예: 태그된 커밋)를 가리킬 때만 적용돼요. 6 | 7 | ## 시그니처 8 | 9 | ```ts 10 | class Reference { 11 | targetPeel(): string | null; 12 | } 13 | ``` 14 | 15 | ### 반환 값 16 | 17 | -------------------------------------------------------------------------------- /docs/ko/reference/Reference/Methods/type.md: -------------------------------------------------------------------------------- 1 | # type 2 | 3 | 레퍼런스의 타입을 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Reference { 9 | type(): ReferenceType | null; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Remote/Methods/name.md: -------------------------------------------------------------------------------- 1 | # name 2 | 3 | 리모트의 이름을 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Remote { 9 | name(): string | null; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | 22 | 23 | ### 에러 24 | 25 | -------------------------------------------------------------------------------- /docs/ko/reference/Remote/Methods/pushurl.md: -------------------------------------------------------------------------------- 1 | # pushurl 2 | 3 | 리모트의 푸시(push) URL을 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Remote { 9 | pushurl(): string | null; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | 22 | 23 | ### 에러 24 | 25 | -------------------------------------------------------------------------------- /docs/ko/reference/Remote/Methods/url.md: -------------------------------------------------------------------------------- 1 | # url 2 | 3 | 리모트의 URL을 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Remote { 9 | url(): string; 10 | } 11 | ``` 12 | 13 | ### 에러 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/addIgnoreRule.md: -------------------------------------------------------------------------------- 1 | # addIgnoreRule 2 | 3 | 리포지토리에 무시 규칙을 추가해요. 4 | 5 | 이것은 리포지토리에 무시 규칙을 추가해요. 이 규칙들은 6 | 기존의 무시 규칙들(.gitignore 파일 등)과 함께 사용돼요. 7 | 8 | ## 시그니처 9 | 10 | ```ts 11 | class Repository { 12 | addIgnoreRule(rules: string): void; 13 | } 14 | ``` 15 | 16 | ### 파라미터 17 | 18 | 25 | 26 | ## 예제 27 | 28 | ```ts 29 | import { openRepository } from 'es-git'; 30 | 31 | const repo = await openRepository('./path/to/repo'); 32 | repo.addIgnoreRule("node_modules/"); 33 | ``` -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/cleanupState.md: -------------------------------------------------------------------------------- 1 | # cleanupState 2 | 3 | 병합, 되돌리기, 체리픽 등과 같은 진행 중인 명령과 관련된 모든 메타데이터를 제거해요. 예: `MERGE_HEAD`, `MERGE_MSG` 등. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | cleanupState(): void; 10 | } 11 | ``` -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/clearIgnoreRules.md: -------------------------------------------------------------------------------- 1 | # clearIgnoreRules 2 | 3 | 명시적으로 추가된 무시 규칙을 지워요. 4 | 5 | 기본 내부 무시 규칙으로 재설정해요. 6 | 이는 파일 시스템에 실제로 존재하는 .gitignore 파일의 규칙은 끄지 않아요. 7 | 기본 내부 무시 규칙은 ".", ".." 및 ".git" 항목을 무시해요. 8 | 9 | ## 시그니처 10 | 11 | ```ts 12 | class Repository { 13 | clearIgnoreRules(): void; 14 | } 15 | ``` 16 | 17 | ## 예제 18 | 19 | ```ts 20 | import { openRepository } from 'es-git'; 21 | 22 | const repo = await openRepository('./path/to/repo'); 23 | repo.addIgnoreRule("*.log"); 24 | // 나중에 추가된 모든 규칙을 지워요 25 | repo.clearIgnoreRules(); 26 | ``` -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/config.md: -------------------------------------------------------------------------------- 1 | # config 2 | 3 | 이 리포지토리의 구성 파일을 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | config(): Config; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/deleteTag.md: -------------------------------------------------------------------------------- 1 | # deleteTag 2 | 3 | 기존 태그 레퍼런스를 삭제해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | deleteTag(name: string): void; 10 | } 11 | ``` 12 | 13 | ### 파라미터 14 | 15 | 25 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/findCommit.md: -------------------------------------------------------------------------------- 1 | # findCommit 2 | 3 | 리포지토리에서 특정 커밋을 조회해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | findCommit(oid: string): Commit | null; 10 | } 11 | ``` 12 | 13 | ### 파라미터 14 | 15 | 22 | 23 | ### 반환 값 24 | 25 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/findObject.md: -------------------------------------------------------------------------------- 1 | # findObject 2 | 3 | 리포지토리에서 특정 Git 개체를 조회해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | findObject(oid: string): GitObject | null; 10 | } 11 | ``` 12 | 13 | ### 파라미터 14 | 15 | 22 | 23 | ### 반환 값 24 | 25 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/findRemote.md: -------------------------------------------------------------------------------- 1 | # findRemote 2 | 3 | 리포지토리에서 특정 리모트를 찾아요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | findRemote(name: string): Remote | null; 10 | } 11 | ``` 12 | 13 | ### 파라미터 14 | 15 | 22 | 23 | ### 반환 값 24 | 25 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/findTag.md: -------------------------------------------------------------------------------- 1 | # findTag 2 | 3 | 리포지토리에서 특정 해시(prefix hash)로 태그를 조회해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | findTag(oid: string): Tag | null; 10 | } 11 | ``` 12 | 13 | ### 파라미터 14 | 15 | 22 | 23 | ### 반환 값 24 | 25 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/findTree.md: -------------------------------------------------------------------------------- 1 | # findTree 2 | 3 | 리포지토리에서 특정 트리 개체를 조회해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | findTree(oid: string): Tree | null; 10 | } 11 | ``` 12 | 13 | ### 파라미터 14 | 15 | 22 | 23 | ### 반환 값 24 | 25 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/getAnnotatedCommit.md: -------------------------------------------------------------------------------- 1 | # getAnnotatedCommit 2 | 3 | 주어진 커밋으로부터 Annotated Commit을 생성해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | getAnnotatedCommit(commit: Commit): AnnotatedCommit; 10 | } 11 | ``` 12 | 13 | ### 파라미터 14 | 15 | 22 | 23 | ### 반환 값 24 | 25 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/getMergeBaseOctopus.md: -------------------------------------------------------------------------------- 1 | # getMergeBaseOctopus 2 | 3 | 옥토퍼스 병합을 준비하기 위해 병합 베이스를 찾아요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | getMergeBaseOctopus(oids: string[]): string; 10 | } 11 | ``` 12 | 13 | ### 파라미터 14 | 15 | 22 | 23 | ### 반환 값 24 | 25 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/getMergeBasesMany.md: -------------------------------------------------------------------------------- 1 | # getMergeBasesMany 2 | 3 | 커밋 목록이 주어졌을 때 모든 병합 베이스를 찾아요 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | getMergeBasesMany(oids: string[]): string[]; 10 | } 11 | ``` 12 | 13 | ### 파라미터 14 | 15 | 22 | 23 | ### 반환 값 24 | 25 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/head.md: -------------------------------------------------------------------------------- 1 | # head 2 | 3 | `HEAD`가 가리키는 레퍼런스를 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | head(): Reference; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | 24 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/headDetached.md: -------------------------------------------------------------------------------- 1 | # headDetached 2 | 3 | 리포지토리 `HEAD`가 분리되었는지 확인해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | headDetached(): boolean; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/index.md: -------------------------------------------------------------------------------- 1 | # index 2 | 3 | 이 리포지토리의 인덱스(Index) 파일을 가져와요. 4 | 5 | 커스텀 인덱스가 설정되지 않았다면, 기본 인덱스(`.git/index`)가 반환돼요. 6 | 7 | ## 시그니처 8 | 9 | ```ts 10 | class Repository { 11 | index(): Index; 12 | } 13 | ``` 14 | 15 | ### 반환 값 16 | 17 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/isBare.md: -------------------------------------------------------------------------------- 1 | # isBare 2 | 3 | 이 리포지토리가 `bare` 리포지토리인지 확인해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | isBare(): boolean; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/isEmpty.md: -------------------------------------------------------------------------------- 1 | # isEmpty 2 | 3 | 이 리포지토리가 비어 있는지 확인해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | isEmpty(): boolean; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/isShallow.md: -------------------------------------------------------------------------------- 1 | # isShallow 2 | 3 | 이 리포지토리가 얕은 클론(shallow clone)인지 확인해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | isShallow(): boolean; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/isWorktree.md: -------------------------------------------------------------------------------- 1 | # isWorktree 2 | 3 | 이 리포지토리가 작업 트리(worktree)인지 확인해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | isWorktree(): boolean; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/mailmap.md: -------------------------------------------------------------------------------- 1 | # mailmap 2 | 3 | 이 리포지토리의 mailmap을 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | mailmap(): Mailmap | null; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/path.md: -------------------------------------------------------------------------------- 1 | # path 2 | 3 | 일반 리포지토리의 경우 `.git` 폴더의 경로를 반환하고, `bare` 리포지토리의 경우 리포지토리 자체의 경로를 반환해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | path(): string; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/remoteNames.md: -------------------------------------------------------------------------------- 1 | # remoteNames 2 | 3 | 리포지토리에 설정된 모든 리모트 목록을 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | remoteNames(): string[]; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | 22 | 23 | ## 예제 24 | 25 | ```ts 26 | import { openRepository } from 'es-git'; 27 | 28 | const repo = await openRepository('/path/to/repo'); 29 | console.log(repo.remoteNames()); // ["origin"] 30 | ``` -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/revwalk.md: -------------------------------------------------------------------------------- 1 | # revwalk 2 | 3 | 커밋 그래프를 탐색할 수 있는 Revwalk를 생성해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | revwalk(): Revwalk; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/setHead.md: -------------------------------------------------------------------------------- 1 | # setHead 2 | 3 | 리포지토리 `HEAD`가 지정된 참조를 가리키도록 만들어요. 4 | 5 | 제공된 참조가 트리나 blob를 가리키는 경우, `HEAD`는 변경되지 않고 오류가 반환돼요. 6 | 7 | 제공된 참조가 브랜치를 가리키는 경우, `HEAD`는 해당 브랜치를 가리키며 연결된 상태를 유지하거나, 아직 연결되지 않았다면 연결돼요. 브랜치가 아직 존재하지 않더라도 오류는 반환되지 않아요. 그러면 `HEAD`는 아직 생성되지 않은 브랜치에 연결돼요. 8 | 9 | 그렇지 않으면, `HEAD`는 분리되어 커밋을 직접 가리켜요. 10 | 11 | ## 시그니처 12 | 13 | ```ts 14 | class Repository { 15 | setHead(refname: string): void; 16 | } 17 | ``` 18 | 19 | ### 파라미터 20 | 21 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/setHeadDetached.md: -------------------------------------------------------------------------------- 1 | # setHeadDetached 2 | 3 | 리포지토리 HEAD가 커밋을 직접 가리키도록 만들어요. 4 | 5 | 제공된 commitish를 리포지토리에서 찾을 수 없으면, HEAD는 변경되지 않고 오류가 반환돼요. 6 | 7 | 제공된 commitish를 커밋으로 벗길 수 없으면, HEAD는 변경되지 않고 오류가 반환돼요. 8 | 9 | 그렇지 않으면, HEAD는 결국 분리되고 벗겨진 커밋을 직접 가리키게 돼요. 10 | 11 | ## 시그니처 12 | 13 | ```ts 14 | class Repository { 15 | setHeadDetached(commitish: Commit): void; 16 | } 17 | ``` 18 | 19 | ### 파라미터 20 | 21 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/setHeadDetachedFromAnnotated.md: -------------------------------------------------------------------------------- 1 | # setHeadDetachedFromAnnotated 2 | 3 | 리포지토리 HEAD가 커밋을 직접 가리키도록 만들어요. 4 | 5 | 제공된 commitish를 리포지토리에서 찾을 수 없으면 HEAD는 변경되지 않고 오류가 반환돼요. 6 | 제공된 commitish를 커밋으로 벗길 수 없으면 HEAD는 변경되지 않고 오류가 반환돼요. 7 | 그렇지 않으면 HEAD는 결국 분리되어 벗겨진 커밋을 직접 가리키게 돼요. 8 | 9 | ## 시그니처 10 | 11 | ```ts 12 | class Repository { 13 | setHeadDetachedFromAnnotated(commitish: AnnotatedCommit): void; 14 | } 15 | ``` 16 | 17 | ### 파라미터 18 | 19 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/state.md: -------------------------------------------------------------------------------- 1 | # state 2 | 3 | 현재 리포지토리의 상태를 반환해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | state(): RepositoryState; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/statuses.md: -------------------------------------------------------------------------------- 1 | # statuses 2 | 3 | 파일 상태 정보를 수집하고 반환된 구조체를 채워요. 4 | 5 | 상태를 필터링하기 위해 옵션에 pathspec이 주어진 경우, 이름 변경 감지(활성화한 경우)의 결과가 정확하지 않을 수 있다는 점에 주의해요. 이름 변경 감지를 올바르게 수행하려면 모든 파일을 고려할 수 있도록 pathspec 없이 호출해야 해요. 6 | 7 | ## 시그니처 8 | 9 | ```ts 10 | class Repository { 11 | statuses(): Statuses; 12 | } 13 | ``` 14 | 15 | ### 반환 값 16 | 17 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/tagNames.md: -------------------------------------------------------------------------------- 1 | # tagNames 2 | 3 | 리포지토리에 있는 모든 태그 목록을 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | tagNames(pattern?: string | null | undefined): string[]; 10 | } 11 | ``` 12 | 13 | ### 파라미터 14 | 15 | 22 | -------------------------------------------------------------------------------- /docs/ko/reference/Repository/Methods/workdir.md: -------------------------------------------------------------------------------- 1 | # workdir 2 | 3 | 현재 리포지토리의 작업 디렉터리 경로를 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Repository { 9 | workdir(): string | null; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Revwalk/Methods/hide.md: -------------------------------------------------------------------------------- 1 | # hide 2 | 3 | 이 메서드를 사용하면 지정한 커밋을 기준으로 그 이전의 커밋들이 탐색 대상에서 제외돼요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Revwalk { 9 | hide(oid: string): this; 10 | } 11 | ``` 12 | 13 | ### 파라미터 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Revwalk/Methods/hideGlob.md: -------------------------------------------------------------------------------- 1 | # hideGlob 2 | 3 | 주어진 glob 패턴과 일치하는 레퍼런스를 숨겨요. 4 | 5 | 이 메서드를 사용하면 해당 레퍼런스가 가리키는 OID와 그 조상 커밋들이 Revwalk 결과에서 제외돼요. 6 | 7 | ## 시그니처 8 | 9 | ```ts 10 | class Revwalk { 11 | hideGlob(glob: string): this; 12 | } 13 | ``` 14 | 15 | ### 파라미터 16 | 17 | -------------------------------------------------------------------------------- /docs/ko/reference/Revwalk/Methods/hideHead.md: -------------------------------------------------------------------------------- 1 | # hideHead 2 | 3 | 리포지토리의 `HEAD`를 숨겨요. 4 | 5 | 이 메서드를 호출하면 `HEAD`가 가리키는 커밋과 그 조상 커밋들이 Revwalk 결과에서 제외돼요. 6 | 7 | ## 시그니처 8 | 9 | ```ts 10 | class Revwalk { 11 | hideHead(): this; 12 | } 13 | ``` -------------------------------------------------------------------------------- /docs/ko/reference/Revwalk/Methods/hideRef.md: -------------------------------------------------------------------------------- 1 | # hideRef 2 | 3 | 주어진 레퍼런스가 가리키는 OID를 숨겨요. 4 | 5 | 이 메서드를 사용하면 해당 레퍼런스가 가리키는 커밋과 그 조상 커밋들이 Revwalk 결과에서 제외돼요. 6 | 7 | ## 시그니처 8 | 9 | ```ts 10 | class Revwalk { 11 | hideRef(reference: string): this; 12 | } 13 | ``` 14 | 15 | ### 파라미터 16 | 17 | -------------------------------------------------------------------------------- /docs/ko/reference/Revwalk/Methods/push.md: -------------------------------------------------------------------------------- 1 | # push 2 | 3 | 탐색을 시작할 커밋을 추가해요. 4 | 5 | 주어진 OID는 Revwalk가 순회할 리포지토리에 속한 커밋이어야 해요. 이 커밋은 탐색의 시작점으로 사용돼요. 6 | 7 | Revwalk를 시작하려면 최소 하나 이상의 커밋을 `push`해야 해요. 8 | 9 | ## 시그니처 10 | 11 | ```ts 12 | class Revwalk { 13 | push(oid: string): this; 14 | } 15 | ``` 16 | 17 | ### 파라미터 18 | 19 | -------------------------------------------------------------------------------- /docs/ko/reference/Revwalk/Methods/pushGlob.md: -------------------------------------------------------------------------------- 1 | # pushGlob 2 | 3 | 주어진 glob 패턴과 일치하는 레퍼런스를 추가해요. 4 | 5 | 이 메서드를 사용하면 해당 레퍼런스가 가리키는 OID들이 Revwalk의 탐색 시작점으로 추가돼요. 6 | 7 | ## 시그니처 8 | 9 | ```ts 10 | class Revwalk { 11 | pushGlob(glob: string): this; 12 | } 13 | ``` 14 | 15 | ### 파라미터 16 | 17 | -------------------------------------------------------------------------------- /docs/ko/reference/Revwalk/Methods/pushHead.md: -------------------------------------------------------------------------------- 1 | # pushHead 2 | 3 | 리포지토리의 `HEAD`를 Revwalk의 탐색 시작점으로 추가해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Revwalk { 9 | pushHead(): this; 10 | } 11 | ``` -------------------------------------------------------------------------------- /docs/ko/reference/Revwalk/Methods/pushRange.md: -------------------------------------------------------------------------------- 1 | # pushRange 2 | 3 | 주어진 커밋 범위의 시작점을 숨기고 끝점을 탐색 시작점으로 추가해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Revwalk { 9 | pushRange(range: string): this; 10 | } 11 | ``` 12 | 13 | ### 파라미터 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Revwalk/Methods/pushRef.md: -------------------------------------------------------------------------------- 1 | # pushRef 2 | 3 | 주어진 레퍼런스가 가리키는 OID를 추가해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Revwalk { 9 | pushRef(reference: string): this; 10 | } 11 | ``` 12 | 13 | ### 파라미터 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Revwalk/Methods/reset.md: -------------------------------------------------------------------------------- 1 | # reset 2 | 3 | Revwalk를 재구성할 수 있도록 리셋 해요. 4 | 5 | Iteration)이 완료되면 Revwalk는 자동으로 리셋 돼요. 6 | 7 | ## 시그니처 8 | 9 | ```ts 10 | class Revwalk { 11 | reset(): this; 12 | } 13 | ``` -------------------------------------------------------------------------------- /docs/ko/reference/Revwalk/Methods/simplifyFirstParent.md: -------------------------------------------------------------------------------- 1 | # simplifyFirstParent 2 | 3 | 첫 번째 부모(First Parent)를 기준으로 히스토리를 단순화해요. 4 | 5 | 각 커밋당 첫 번째 부모 외의 다른 부모들은 큐에 추가되지 않아요. 6 | 7 | ## 시그니처 8 | 9 | ```ts 10 | class Revwalk { 11 | simplifyFirstParent(): this; 12 | } 13 | ``` -------------------------------------------------------------------------------- /docs/ko/reference/Tag/Methods/id.md: -------------------------------------------------------------------------------- 1 | # id 2 | 3 | 리포지토리 태그의 id(SHA1)를 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Tag { 9 | id(): string; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | 22 | -------------------------------------------------------------------------------- /docs/ko/reference/Tag/Methods/message.md: -------------------------------------------------------------------------------- 1 | # message 2 | 3 | 태그의 메시지를 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Tag { 9 | message(): string | null; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | 22 | -------------------------------------------------------------------------------- /docs/ko/reference/Tag/Methods/name.md: -------------------------------------------------------------------------------- 1 | # name 2 | 3 | 태그의 이름을 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Tag { 9 | name(): string; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | 22 | 23 | ### 에러 24 | 25 | 32 | -------------------------------------------------------------------------------- /docs/ko/reference/Tag/Methods/peel.md: -------------------------------------------------------------------------------- 1 | # peel 2 | 3 | 태그가 아닌 Git 개체가 나올 때까지 태그를 재귀적으로 벗겨내요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Tag { 9 | peel(): GitObject; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | 22 | -------------------------------------------------------------------------------- /docs/ko/reference/Tag/Methods/target.md: -------------------------------------------------------------------------------- 1 | # target 2 | 3 | 태그가 가리키는 Git 개체를 가져와요. 4 | 5 | 이 메서드는 주어진 개체를 리포지토리에서 조회하고 반환해요. 6 | 7 | ## 시그니처 8 | 9 | ```ts 10 | class Tag { 11 | target(): GitObject; 12 | } 13 | ``` 14 | 15 | ### 반환 값 16 | 17 | -------------------------------------------------------------------------------- /docs/ko/reference/Tag/Methods/targetId.md: -------------------------------------------------------------------------------- 1 | # targetId 2 | 3 | 태그가 가리키는 Git 개체의 OID를 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Tag { 9 | targetId(): string; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Tag/Methods/targetType.md: -------------------------------------------------------------------------------- 1 | # targetType 2 | 3 | 태그가 가리키는 Git 개체의 타입을 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Tag { 9 | targetType(): ObjectType | null; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Tree/Methods/asObject.md: -------------------------------------------------------------------------------- 1 | # asObject 2 | 3 | 이 트리를 `GitObject` 타입으로 변환해 사용할 수 있게 해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Tree { 9 | asObject(): GitObject; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | -------------------------------------------------------------------------------- /docs/ko/reference/Tree/Methods/get.md: -------------------------------------------------------------------------------- 1 | # get 2 | 3 | 트리에서 특정 위치의 트리 항목을 찾아와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Tree { 9 | get(index: number): TreeEntry | null; 10 | } 11 | ``` 12 | 13 | ### 파라미터 14 | 15 | 22 | 23 | ### 반환 값 24 | 25 | 32 | -------------------------------------------------------------------------------- /docs/ko/reference/Tree/Methods/getId.md: -------------------------------------------------------------------------------- 1 | # getId 2 | 3 | SHA 값을 이용해 트리 항목을 찾아와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Tree { 9 | getId(id: string): TreeEntry | null; 10 | } 11 | ``` 12 | 13 | ### 파라미터 14 | 15 | 22 | 23 | ### 반환 값 24 | 25 | 32 | -------------------------------------------------------------------------------- /docs/ko/reference/Tree/Methods/getName.md: -------------------------------------------------------------------------------- 1 | # getName 2 | 3 | 파일 이름을 이용해 트리 항목을 찾아와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Tree { 9 | getName(filename: string): TreeEntry | null; 10 | } 11 | ``` 12 | 13 | ### 파라미터 14 | 15 | 22 | 23 | ### 반환 값 24 | 25 | 32 | -------------------------------------------------------------------------------- /docs/ko/reference/Tree/Methods/getPath.md: -------------------------------------------------------------------------------- 1 | # getPath 2 | 3 | 상대 경로를 사용하여 트리 또는 하위 트리에 포함된 트리 항목을 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Tree { 9 | getPath(path: string): TreeEntry | null; 10 | } 11 | ``` 12 | 13 | ### 파라미터 14 | 15 | 22 | 23 | ### 반환 값 24 | 25 | 32 | -------------------------------------------------------------------------------- /docs/ko/reference/Tree/Methods/id.md: -------------------------------------------------------------------------------- 1 | # id 2 | 3 | 리포지토리 개체의 ID(SHA1)를 반환해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Tree { 9 | id(): string; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | 22 | -------------------------------------------------------------------------------- /docs/ko/reference/Tree/Methods/isEmpty.md: -------------------------------------------------------------------------------- 1 | # isEmpty 2 | 3 | 트리에 항목이 비어있는지 확인해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Tree { 9 | isEmpty(): boolean; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | 22 | -------------------------------------------------------------------------------- /docs/ko/reference/Tree/Methods/iter.md: -------------------------------------------------------------------------------- 1 | # iter 2 | 3 | 트리 내 항목들을 순회할 수 있는 반복자(iterator)를 반환해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Tree { 9 | iter(): TreeIter; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | 22 | -------------------------------------------------------------------------------- /docs/ko/reference/Tree/Methods/len.md: -------------------------------------------------------------------------------- 1 | # len 2 | 3 | 트리에 포함된 항목(entry)의 개수를 반환해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class Tree { 9 | len(): bigint; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | 22 | -------------------------------------------------------------------------------- /docs/ko/reference/Tree/TreeEntry/filemode.md: -------------------------------------------------------------------------------- 1 | # filemode 2 | 3 | 트리 항목(tree entry)의 UNIX 파일 속성(attribute)을 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class TreeEntry { 9 | filemode(): number; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | 22 | -------------------------------------------------------------------------------- /docs/ko/reference/Tree/TreeEntry/id.md: -------------------------------------------------------------------------------- 1 | # id 2 | 3 | 트리 항목(entry)이 가리키는 개체의 ID를 반환해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class TreeEntry { 9 | id(): string; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | 22 | -------------------------------------------------------------------------------- /docs/ko/reference/Tree/TreeEntry/name.md: -------------------------------------------------------------------------------- 1 | # name 2 | 3 | 트리 항목(tree entry)의 파일 이름을 반환해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class TreeEntry { 9 | name(): string; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | 22 | 23 | ### 에러 24 | 25 | 32 | -------------------------------------------------------------------------------- /docs/ko/reference/Tree/TreeEntry/toObject.md: -------------------------------------------------------------------------------- 1 | # toObject 2 | 3 | 트리 항목(tree entry)을 해당 항목이 가리키는 GitObject로 변환해요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class TreeEntry { 9 | toObject(repo: Repository): GitObject; 10 | } 11 | ``` 12 | 13 | ### 파라미터 14 | 15 | 22 | 23 | ### 반환 값 24 | 25 | 32 | -------------------------------------------------------------------------------- /docs/ko/reference/Tree/TreeEntry/type.md: -------------------------------------------------------------------------------- 1 | # type 2 | 3 | 트리 항목이 가리키는 개체의 타입을 가져와요. 4 | 5 | ## 시그니처 6 | 7 | ```ts 8 | class TreeEntry { 9 | type(): ObjectType | null; 10 | } 11 | ``` 12 | 13 | ### 반환 값 14 | 15 | 23 | -------------------------------------------------------------------------------- /docs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "docs", 3 | "type": "module", 4 | "private": true, 5 | "scripts": { 6 | "gen": "tsx gen/cli.ts", 7 | "dev": "vitepress dev", 8 | "build": "vitepress build", 9 | "preview": "vitepress preview" 10 | }, 11 | "dependencies": { 12 | "clipanion": "^4.0.0-rc.4", 13 | "dotenv": "^16.5.0", 14 | "es-toolkit": "^1.32.0", 15 | "fast-glob": "^3.3.3", 16 | "micromatch": "^4.0.8", 17 | "openai": "^4.95.1", 18 | "typanion": "^3.14.0", 19 | "typedoc": "0.28.0", 20 | "vitepress": "^1.6.3", 21 | "vitepress-jsdoc": "^1.0.4" 22 | }, 23 | "devDependencies": { 24 | "@types/micromatch": "^4", 25 | "tsx": "^4.19.3", 26 | "typescript": "5.7.3" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /docs/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/docs/public/apple-touch-icon.png -------------------------------------------------------------------------------- /docs/public/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/docs/public/favicon-96x96.png -------------------------------------------------------------------------------- /docs/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/docs/public/favicon.ico -------------------------------------------------------------------------------- /docs/public/hero.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/docs/public/hero.webp -------------------------------------------------------------------------------- /docs/public/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/docs/public/logo.png -------------------------------------------------------------------------------- /docs/public/og.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/docs/public/og.png -------------------------------------------------------------------------------- /docs/public/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "es-git", 3 | "short_name": "es-git", 4 | "icons": [ 5 | { 6 | "src": "/web-app-manifest-192x192.png", 7 | "sizes": "192x192", 8 | "type": "image/png", 9 | "purpose": "maskable" 10 | }, 11 | { 12 | "src": "/web-app-manifest-512x512.png", 13 | "sizes": "512x512", 14 | "type": "image/png", 15 | "purpose": "maskable" 16 | } 17 | ], 18 | "theme_color": "#ffffff", 19 | "background_color": "#ffffff", 20 | "display": "standalone" 21 | } -------------------------------------------------------------------------------- /docs/public/web-app-manifest-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/docs/public/web-app-manifest-192x192.png -------------------------------------------------------------------------------- /docs/public/web-app-manifest-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/docs/public/web-app-manifest-512x512.png -------------------------------------------------------------------------------- /docs/reference/Blob/Methods/content.md: -------------------------------------------------------------------------------- 1 | # content 2 | 3 | Get the content of this blob. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Blob { 9 | content(): Uint8Array; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Blob/Methods/id.md: -------------------------------------------------------------------------------- 1 | # id 2 | 3 | Get the id (SHA1) of a repository blob. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Blob { 9 | id(): string; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Blob/Methods/isBinary.md: -------------------------------------------------------------------------------- 1 | # isBinary 2 | 3 | Determine if the blob content is most certainly binary or not. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Blob { 9 | isBinary(): boolean; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Blob/Methods/size.md: -------------------------------------------------------------------------------- 1 | # size 2 | 3 | Get the size in bytes of the contents of this blob. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Blob { 9 | size(): bigint; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Branch/Methods/delete.md: -------------------------------------------------------------------------------- 1 | # delete 2 | 3 | Delete an existing branch reference. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Branch { 9 | delete(): void; 10 | } 11 | ``` -------------------------------------------------------------------------------- /docs/reference/Branch/Methods/findUpstream.md: -------------------------------------------------------------------------------- 1 | # findUpstream 2 | 3 | Return the reference supporting the remote tracking branch, given a 4 | local branch reference. 5 | 6 | ## Signature 7 | 8 | ```ts 9 | class Branch { 10 | findUpstream(): Branch | null; 11 | } 12 | ``` 13 | 14 | ### Returns 15 | 16 | -------------------------------------------------------------------------------- /docs/reference/Branch/Methods/getUpstream.md: -------------------------------------------------------------------------------- 1 | # getUpstream 2 | 3 | Return the reference supporting the remote tracking branch, given a 4 | local branch reference. 5 | 6 | ## Signature 7 | 8 | ```ts 9 | class Branch { 10 | getUpstream(): Branch; 11 | } 12 | ``` 13 | 14 | ### Returns 15 | 16 | 23 | 24 | ### Errors 25 | 26 | -------------------------------------------------------------------------------- /docs/reference/Branch/Methods/isHead.md: -------------------------------------------------------------------------------- 1 | # isHead 2 | 3 | Determine if the current local branch is pointed at by `HEAD`. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Branch { 9 | isHead(): boolean; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Branch/Methods/name.md: -------------------------------------------------------------------------------- 1 | # name 2 | 3 | Return the name of the given local or remote branch. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Branch { 9 | name(): string; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | 22 | 23 | ### Errors 24 | 25 | -------------------------------------------------------------------------------- /docs/reference/Branch/Methods/referenceTarget.md: -------------------------------------------------------------------------------- 1 | # referenceTarget 2 | 3 | Get the OID pointed to by a reference which is this branch. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Branch { 9 | referenceTarget(): string | null; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Branch/Methods/setUpstream.md: -------------------------------------------------------------------------------- 1 | # setUpstream 2 | 3 | Set the upstream configuration for a given local branch. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Branch { 9 | setUpstream(upstreamName: string): void; 10 | } 11 | ``` 12 | 13 | ### Parameters 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Branch/Methods/unsetUpstream.md: -------------------------------------------------------------------------------- 1 | # unsetUpstream 2 | 3 | Unset the upstream configuration for a given local branch. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Branch { 9 | unsetUpstream(): void; 10 | } 11 | ``` -------------------------------------------------------------------------------- /docs/reference/Branch/isValidBranchName.md: -------------------------------------------------------------------------------- 1 | # isValidBranchName 2 | 3 | Ensure the branch name is well-formed. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | function isValidBranchName(name: string): boolean; 9 | ``` 10 | 11 | ### Parameters 12 | 13 | 20 | 21 | ### Returns 22 | 23 | -------------------------------------------------------------------------------- /docs/reference/Commit/Methods/asObject.md: -------------------------------------------------------------------------------- 1 | # asObject 2 | 3 | Casts this Commit to be usable as an `GitObject`. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Commit { 9 | asObject(): GitObject; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Commit/Methods/id.md: -------------------------------------------------------------------------------- 1 | # id 2 | 3 | Get the id (SHA1) of a repository commit 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Commit { 9 | id(): string; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Commit/Methods/time.md: -------------------------------------------------------------------------------- 1 | # time 2 | 3 | Get the commit time (i.e. committer time) of a commit. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Commit { 9 | time(): Date; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Commit/Methods/tree.md: -------------------------------------------------------------------------------- 1 | # tree 2 | 3 | Get the tree pointed to by a commit. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Commit { 9 | tree(): Tree; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Diff/DiffDelta/flags.md: -------------------------------------------------------------------------------- 1 | # flags 2 | 3 | Returns the flags on the delta. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class DiffDelta { 9 | flags(): number; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | 22 | 23 | ## Examples 24 | 25 | ```ts 26 | import { DiffDelta, DiffFlags, diffFlagsContains } from 'es-git'; 27 | 28 | const delta: DiffDelta; 29 | console.assert(diffFlagsContains(delta.flags(), DiffFlags.Binary | DiffFlags.ValidId)); 30 | ``` -------------------------------------------------------------------------------- /docs/reference/Diff/DiffDelta/newFile.md: -------------------------------------------------------------------------------- 1 | # newFile 2 | 3 | Return the file which represents the "to" side of the diff. 4 | 5 | What side this means depends on the function that was used to generate 6 | the diff and will be documented on the function itself. 7 | 8 | ## Signature 9 | 10 | ```ts 11 | class DiffDelta { 12 | newFile(): DiffFile; 13 | } 14 | ``` 15 | 16 | ### Returns 17 | 18 | -------------------------------------------------------------------------------- /docs/reference/Diff/DiffDelta/numFiles.md: -------------------------------------------------------------------------------- 1 | # numFiles 2 | 3 | Returns the number of files in this delta. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class DiffDelta { 9 | numFiles(): number; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Diff/DiffDelta/oldFile.md: -------------------------------------------------------------------------------- 1 | # oldFile 2 | 3 | Return the file which represents the "from" side of the diff. 4 | 5 | What side this means depends on the function that was used to generate 6 | the diff and will be documented on the function itself. 7 | 8 | ## Signature 9 | 10 | ```ts 11 | class DiffDelta { 12 | oldFile(): DiffFile; 13 | } 14 | ``` 15 | 16 | ### Returns 17 | 18 | -------------------------------------------------------------------------------- /docs/reference/Diff/DiffFile/exists.md: -------------------------------------------------------------------------------- 1 | # exists 2 | 3 | Returns `true` if file exists at this side of the delta. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class DiffFile { 9 | exists(): boolean; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Diff/DiffFile/id.md: -------------------------------------------------------------------------------- 1 | # id 2 | 3 | Returns the Oid of this item. 4 | 5 | If this entry represents an absent side of a diff (e.g. the `oldFile` 6 | of a `Added` delta), then the oid returned will be zeroes. 7 | 8 | ## Signature 9 | 10 | ```ts 11 | class DiffFile { 12 | id(): string; 13 | } 14 | ``` 15 | 16 | ### Returns 17 | 18 | -------------------------------------------------------------------------------- /docs/reference/Diff/DiffFile/isBinary.md: -------------------------------------------------------------------------------- 1 | # isBinary 2 | 3 | Returns `true` if file(s) are treated as binary data. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class DiffFile { 9 | isBinary(): boolean; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Diff/DiffFile/isValidId.md: -------------------------------------------------------------------------------- 1 | # isValidId 2 | 3 | Returns `true` if `id` value is known correct. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class DiffFile { 9 | isValidId(): boolean; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Diff/DiffFile/mode.md: -------------------------------------------------------------------------------- 1 | # mode 2 | 3 | Returns file mode. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class DiffFile { 9 | mode(): FileMode; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Diff/DiffFile/path.md: -------------------------------------------------------------------------------- 1 | # path 2 | 3 | Returns the path of the entry relative to the working directory of the 4 | repository. 5 | 6 | ## Signature 7 | 8 | ```ts 9 | class DiffFile { 10 | path(): string | null; 11 | } 12 | ``` 13 | 14 | ### Returns 15 | 16 | -------------------------------------------------------------------------------- /docs/reference/Diff/DiffFile/size.md: -------------------------------------------------------------------------------- 1 | # size 2 | 3 | Returns the size of this entry, in bytes. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class DiffFile { 9 | size(): bigint; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Diff/Methods/deltas.md: -------------------------------------------------------------------------------- 1 | # deltas 2 | 3 | Returns an iterator over the deltas in this diff. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Diff { 9 | deltas(): Deltas; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Diff/Methods/isSortedIcase.md: -------------------------------------------------------------------------------- 1 | # isSortedIcase 2 | 3 | Check if deltas are sorted case sensitively or insensitively. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Diff { 9 | isSortedIcase(): boolean; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Diff/Methods/stats.md: -------------------------------------------------------------------------------- 1 | # stats 2 | 3 | Accumulate diff statistics for all patches. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Diff { 9 | stats(): DiffStats; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/GitObject/Methods/asCommit.md: -------------------------------------------------------------------------------- 1 | # asCommit 2 | 3 | Attempt to view this object as a commit. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class GitObject { 9 | asCommit(): Commit | null; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/GitObject/Methods/id.md: -------------------------------------------------------------------------------- 1 | # id 2 | 3 | Get the id (SHA1) of a repository object. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class GitObject { 9 | id(): string; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/GitObject/Methods/peelToBlob.md: -------------------------------------------------------------------------------- 1 | # peelToBlob 2 | 3 | Recursively peel an object until a blob is found. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class GitObject { 9 | peelToBlob(): Blob; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/GitObject/Methods/peelToCommit.md: -------------------------------------------------------------------------------- 1 | # peelToCommit 2 | 3 | Recursively peel an object until a commit is found. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class GitObject { 9 | peelToCommit(): Commit; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/GitObject/Methods/type.md: -------------------------------------------------------------------------------- 1 | # type 2 | 3 | Get the object type of object. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class GitObject { 9 | type(): ObjectType | null; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Index/Methods/count.md: -------------------------------------------------------------------------------- 1 | # count 2 | 3 | Get the count of entries currently in the index. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Index { 9 | count(): number; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Index/Methods/entries.md: -------------------------------------------------------------------------------- 1 | # entries 2 | 3 | Get an iterator over the entries in this index. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Index { 9 | entries(): IndexEntries; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Index/Methods/hasConflicts.md: -------------------------------------------------------------------------------- 1 | # hasConflicts 2 | 3 | Does this index have conflicts? 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Index { 9 | hasConflicts(): boolean; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Index/Methods/isEmpty.md: -------------------------------------------------------------------------------- 1 | # isEmpty 2 | 3 | Return `true` is there is no entry in the index. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Index { 9 | isEmpty(): boolean; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Index/Methods/path.md: -------------------------------------------------------------------------------- 1 | # path 2 | 3 | Get the full path to the index file on disk. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Index { 9 | path(): string | null; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Index/Methods/setVersion.md: -------------------------------------------------------------------------------- 1 | # setVersion 2 | 3 | Set index on-disk version. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Index { 9 | setVersion(version: number): void; 10 | } 11 | ``` 12 | 13 | ### Parameters 14 | 15 | 22 | -------------------------------------------------------------------------------- /docs/reference/Index/Methods/version.md: -------------------------------------------------------------------------------- 1 | # version 2 | 3 | Get index on-disk version. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Index { 9 | version(): number; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Index/Methods/write.md: -------------------------------------------------------------------------------- 1 | # write 2 | 3 | Write an existing index object from memory back to disk using an atomic 4 | file lock. 5 | 6 | ## Signature 7 | 8 | ```ts 9 | class Index { 10 | write(): void; 11 | } 12 | ``` -------------------------------------------------------------------------------- /docs/reference/Index/Methods/writeTree.md: -------------------------------------------------------------------------------- 1 | # writeTree 2 | 3 | Write the index as a tree. 4 | 5 | This method will scan the index and write a representation of its 6 | current state back to disk; it recursively creates tree objects for each 7 | of the subtrees stored in the index, but only returns the OID of the 8 | root tree. This is the OID that can be used e.g. to create a commit. 9 | 10 | The index instance cannot be bare, and needs to be associated to an 11 | existing repository. 12 | 13 | The index must not contain any file in conflict. 14 | 15 | ## Signature 16 | 17 | ```ts 18 | class Index { 19 | writeTree(): string; 20 | } 21 | ``` 22 | -------------------------------------------------------------------------------- /docs/reference/Oid/zeroOid.md: -------------------------------------------------------------------------------- 1 | # zeroOid 2 | 3 | Creates an all zero Oid structure. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | function zeroOid(): string; 9 | ``` 10 | 11 | ### Returns 12 | 13 | -------------------------------------------------------------------------------- /docs/reference/Reference/Methods/delete.md: -------------------------------------------------------------------------------- 1 | # delete 2 | 3 | Delete an existing reference. 4 | 5 | This method works for both direct and symbolic references. The reference 6 | will be immediately removed on disk. 7 | 8 | ## Signature 9 | 10 | ```ts 11 | class Reference { 12 | delete(): void; 13 | } 14 | ``` 15 | 16 | ### Errors 17 | 18 | -------------------------------------------------------------------------------- /docs/reference/Reference/Methods/isBranch.md: -------------------------------------------------------------------------------- 1 | # isBranch 2 | 3 | Check if a reference is a local branch. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Reference { 9 | isBranch(): boolean; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Reference/Methods/isNote.md: -------------------------------------------------------------------------------- 1 | # isNote 2 | 3 | Check if a reference is a note. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Reference { 9 | isNote(): boolean; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Reference/Methods/isRemote.md: -------------------------------------------------------------------------------- 1 | # isRemote 2 | 3 | Check if a reference is a remote tracking branch. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Reference { 9 | isRemote(): boolean; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Reference/Methods/isTag.md: -------------------------------------------------------------------------------- 1 | # isTag 2 | 3 | Check if a reference is a tag. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Reference { 9 | isTag(): boolean; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Reference/Methods/name.md: -------------------------------------------------------------------------------- 1 | # name 2 | 3 | Get the full name of a reference. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Reference { 9 | name(): string; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | 22 | 23 | ### Errors 24 | 25 | -------------------------------------------------------------------------------- /docs/reference/Reference/Methods/peelToTree.md: -------------------------------------------------------------------------------- 1 | # peelToTree 2 | 3 | Peel a reference to a tree. 4 | 5 | This method recursively peels the reference until it reaches 6 | a tree. 7 | 8 | ## Signature 9 | 10 | ```ts 11 | class Reference { 12 | peelToTree(): Tree; 13 | } 14 | ``` 15 | 16 | ### Returns 17 | 18 | -------------------------------------------------------------------------------- /docs/reference/Reference/Methods/resolve.md: -------------------------------------------------------------------------------- 1 | # resolve 2 | 3 | Resolve a symbolic reference to a direct reference. 4 | 5 | This method iteratively peels a symbolic reference until it resolves to 6 | a direct reference to an OID. 7 | 8 | If a direct reference is passed as an argument, a copy of that 9 | reference is returned. 10 | 11 | ## Signature 12 | 13 | ```ts 14 | class Reference { 15 | resolve(): Reference; 16 | } 17 | ``` 18 | 19 | ### Returns 20 | 21 | -------------------------------------------------------------------------------- /docs/reference/Reference/Methods/symbolicTarget.md: -------------------------------------------------------------------------------- 1 | # symbolicTarget 2 | 3 | Get full name to the reference pointed to by a symbolic reference. 4 | 5 | Only available if the reference is symbolic. 6 | 7 | ## Signature 8 | 9 | ```ts 10 | class Reference { 11 | symbolicTarget(): string | null; 12 | } 13 | ``` 14 | 15 | ### Returns 16 | 17 | -------------------------------------------------------------------------------- /docs/reference/Reference/Methods/target.md: -------------------------------------------------------------------------------- 1 | # target 2 | 3 | Get the OID pointed to by a direct reference. 4 | 5 | Only available if the reference is direct (i.e. an object id reference, 6 | not a symbolic one). 7 | 8 | ## Signature 9 | 10 | ```ts 11 | class Reference { 12 | target(): string | null; 13 | } 14 | ``` 15 | 16 | ### Returns 17 | 18 | -------------------------------------------------------------------------------- /docs/reference/Reference/Methods/targetPeel.md: -------------------------------------------------------------------------------- 1 | # targetPeel 2 | 3 | Return the peeled OID target of this reference. 4 | 5 | This peeled OID only applies to direct references that point to a hard. 6 | 7 | ## Signature 8 | 9 | ```ts 10 | class Reference { 11 | targetPeel(): string | null; 12 | } 13 | ``` 14 | 15 | ### Returns 16 | 17 | -------------------------------------------------------------------------------- /docs/reference/Reference/Methods/type.md: -------------------------------------------------------------------------------- 1 | # type 2 | 3 | Get the reference type of a reference. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Reference { 9 | type(): ReferenceType | null; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Remote/Methods/name.md: -------------------------------------------------------------------------------- 1 | # name 2 | 3 | Get the remote's name. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Remote { 9 | name(): string | null; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | 22 | 23 | ### Errors 24 | 25 | -------------------------------------------------------------------------------- /docs/reference/Remote/Methods/pushurl.md: -------------------------------------------------------------------------------- 1 | # pushurl 2 | 3 | Get the remote's URL. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Remote { 9 | pushurl(): string | null; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | 22 | 23 | ### Errors 24 | 25 | -------------------------------------------------------------------------------- /docs/reference/Remote/Methods/url.md: -------------------------------------------------------------------------------- 1 | # url 2 | 3 | Get the remote's URL. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Remote { 9 | url(): string; 10 | } 11 | ``` 12 | 13 | ### Errors 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Repository/Methods/cleanupState.md: -------------------------------------------------------------------------------- 1 | # cleanupState 2 | 3 | Remove all the metadata associated with an ongoing command like merge, 4 | revert, cherry-pick, etc. For example: `MERGE_HEAD`, `MERGE_MSG`, etc. 5 | 6 | ## Signature 7 | 8 | ```ts 9 | class Repository { 10 | cleanupState(): void; 11 | } 12 | ``` -------------------------------------------------------------------------------- /docs/reference/Repository/Methods/clearIgnoreRules.md: -------------------------------------------------------------------------------- 1 | # clearIgnoreRules 2 | 3 | Clear ignore rules that were explicitly added. 4 | 5 | Resets to the default internal ignore rules. 6 | This will not turn off rules in .gitignore files that actually exist in the filesystem. 7 | The default internal ignores ignore ".", ".." and ".git" entries. 8 | 9 | ## Signature 10 | 11 | ```ts 12 | class Repository { 13 | clearIgnoreRules(): void; 14 | } 15 | ``` 16 | 17 | ## Examples 18 | 19 | ```ts 20 | import { openRepository } from 'es-git'; 21 | 22 | const repo = await openRepository('./path/to/repo'); 23 | repo.addIgnoreRule("*.log"); 24 | // Later, clear all added rules 25 | repo.clearIgnoreRules(); 26 | ``` -------------------------------------------------------------------------------- /docs/reference/Repository/Methods/config.md: -------------------------------------------------------------------------------- 1 | # config 2 | 3 | Get the configuration file for this repository. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Repository { 9 | config(): Config; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Repository/Methods/deleteTag.md: -------------------------------------------------------------------------------- 1 | # deleteTag 2 | 3 | Delete an existing tag reference. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Repository { 9 | deleteTag(name: string): void; 10 | } 11 | ``` 12 | 13 | ### Parameters 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Repository/Methods/findRemote.md: -------------------------------------------------------------------------------- 1 | # findRemote 2 | 3 | Find remote from repository. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Repository { 9 | findRemote(name: string): Remote | null; 10 | } 11 | ``` 12 | 13 | ### Parameters 14 | 15 | 21 | 22 | ### Returns 23 | 24 | -------------------------------------------------------------------------------- /docs/reference/Repository/Methods/findTag.md: -------------------------------------------------------------------------------- 1 | # findTag 2 | 3 | Lookup a tag object by prefix hash from the repository. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Repository { 9 | findTag(oid: string): Tag | null; 10 | } 11 | ``` 12 | 13 | ### Parameters 14 | 15 | 22 | 23 | ### Returns 24 | 25 | -------------------------------------------------------------------------------- /docs/reference/Repository/Methods/getTag.md: -------------------------------------------------------------------------------- 1 | # getTag 2 | 3 | Lookup a tag object by prefix hash from the repository. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Repository { 9 | getTag(oid: string): Tag; 10 | } 11 | ``` 12 | 13 | ### Parameters 14 | 15 | 22 | 23 | ### Errors 24 | 25 | -------------------------------------------------------------------------------- /docs/reference/Repository/Methods/head.md: -------------------------------------------------------------------------------- 1 | # head 2 | 3 | Retrieve and resolve the reference pointed at by `HEAD`. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Repository { 9 | head(): Reference; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Repository/Methods/headDetached.md: -------------------------------------------------------------------------------- 1 | # headDetached 2 | 3 | Determines whether the repository `HEAD` is detached. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Repository { 9 | headDetached(): boolean; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Repository/Methods/index.md: -------------------------------------------------------------------------------- 1 | # index 2 | 3 | Get the Index file for this repository. 4 | 5 | If a custom index has not been set, the default index for the repository 6 | will be returned (the one located in `.git/index`). 7 | 8 | ## Signature 9 | 10 | ```ts 11 | class Repository { 12 | index(): Index; 13 | } 14 | ``` 15 | 16 | ### Returns 17 | 18 | -------------------------------------------------------------------------------- /docs/reference/Repository/Methods/isBare.md: -------------------------------------------------------------------------------- 1 | # isBare 2 | 3 | Tests whether this repository is a bare repository or not. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Repository { 9 | isBare(): boolean; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Repository/Methods/isEmpty.md: -------------------------------------------------------------------------------- 1 | # isEmpty 2 | 3 | Tests whether this repository is empty. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Repository { 9 | isEmpty(): boolean; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Repository/Methods/isShallow.md: -------------------------------------------------------------------------------- 1 | # isShallow 2 | 3 | Tests whether this repository is a shallow clone. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Repository { 9 | isShallow(): boolean; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Repository/Methods/isWorktree.md: -------------------------------------------------------------------------------- 1 | # isWorktree 2 | 3 | Tests whether this repository is a worktree. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Repository { 9 | isWorktree(): boolean; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Repository/Methods/mailmap.md: -------------------------------------------------------------------------------- 1 | # mailmap 2 | 3 | Gets this repository's mailmap. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Repository { 9 | mailmap(): Mailmap | null; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Repository/Methods/path.md: -------------------------------------------------------------------------------- 1 | # path 2 | 3 | Returns the path to the `.git` folder for normal repositories or the 4 | repository itself for bare repositories. 5 | 6 | ## Signature 7 | 8 | ```ts 9 | class Repository { 10 | path(): string; 11 | } 12 | ``` 13 | 14 | ### Returns 15 | 16 | -------------------------------------------------------------------------------- /docs/reference/Repository/Methods/remoteNames.md: -------------------------------------------------------------------------------- 1 | # remoteNames 2 | 3 | List all remotes for a given repository 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Repository { 9 | remoteNames(): string[]; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | 22 | 23 | ## Examples 24 | 25 | ```ts 26 | import { openRepository } from 'es-git'; 27 | 28 | const repo = await openRepository('/path/to/repo'); 29 | console.log(repo.remoteNames()); // ["origin"] 30 | ``` -------------------------------------------------------------------------------- /docs/reference/Repository/Methods/revwalk.md: -------------------------------------------------------------------------------- 1 | # revwalk 2 | 3 | Create a revwalk that can be used to traverse the commit graph. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Repository { 9 | revwalk(): Revwalk; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Repository/Methods/statuses.md: -------------------------------------------------------------------------------- 1 | # statuses 2 | 3 | Gather file status information and populate the returned structure. 4 | 5 | Note that if a pathspec is given in the options to filter the 6 | status, then the results from rename detection (if you enable it) may 7 | not be accurate. To do rename detection properly, this must be called 8 | with no pathspec so that all files can be considered. 9 | 10 | ## Signature 11 | 12 | ```ts 13 | class Repository { 14 | statuses(): Statuses; 15 | } 16 | ``` 17 | 18 | ### Returns 19 | 20 | -------------------------------------------------------------------------------- /docs/reference/Repository/Methods/tagNames.md: -------------------------------------------------------------------------------- 1 | # tagNames 2 | 3 | Get a list with all the tags in the repository. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Repository { 9 | tagNames(pattern?: string | null | undefined): string[]; 10 | } 11 | ``` 12 | 13 | ### Parameters 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Repository/Methods/workdir.md: -------------------------------------------------------------------------------- 1 | # workdir 2 | 3 | Get the path of the working directory for this repository. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Repository { 9 | workdir(): string | null; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Revwalk/Methods/hide.md: -------------------------------------------------------------------------------- 1 | # hide 2 | 3 | Mark a commit as not of interest to this revwalk. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Revwalk { 9 | hide(oid: string): this; 10 | } 11 | ``` 12 | 13 | ### Parameters 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Revwalk/Methods/hideHead.md: -------------------------------------------------------------------------------- 1 | # hideHead 2 | 3 | Hide the repository's HEAD. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Revwalk { 9 | hideHead(): this; 10 | } 11 | ``` -------------------------------------------------------------------------------- /docs/reference/Revwalk/Methods/hideRef.md: -------------------------------------------------------------------------------- 1 | # hideRef 2 | 3 | Hide the OID pointed to by a reference. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Revwalk { 9 | hideRef(reference: string): this; 10 | } 11 | ``` 12 | 13 | ### Parameters 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Revwalk/Methods/push.md: -------------------------------------------------------------------------------- 1 | # push 2 | 3 | Mark a commit to start traversal from. 4 | 5 | The given OID must belong to a commitish on the walked repository. 6 | 7 | The given commit will be used as one of the roots when starting the 8 | revision walk. At least one commit must be pushed onto the walker before 9 | a walk can be started. 10 | 11 | ## Signature 12 | 13 | ```ts 14 | class Revwalk { 15 | push(oid: string): this; 16 | } 17 | ``` 18 | 19 | ### Parameters 20 | 21 | -------------------------------------------------------------------------------- /docs/reference/Revwalk/Methods/pushHead.md: -------------------------------------------------------------------------------- 1 | # pushHead 2 | 3 | Push the repository's HEAD. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Revwalk { 9 | pushHead(): this; 10 | } 11 | ``` -------------------------------------------------------------------------------- /docs/reference/Revwalk/Methods/pushRange.md: -------------------------------------------------------------------------------- 1 | # pushRange 2 | 3 | Push and hide the respective endpoints of the given range. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Revwalk { 9 | pushRange(range: string): this; 10 | } 11 | ``` 12 | 13 | ### Parameters 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Revwalk/Methods/pushRef.md: -------------------------------------------------------------------------------- 1 | # pushRef 2 | 3 | Push the OID pointed to by a reference. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Revwalk { 9 | pushRef(reference: string): this; 10 | } 11 | ``` 12 | 13 | ### Parameters 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Revwalk/Methods/reset.md: -------------------------------------------------------------------------------- 1 | # reset 2 | 3 | Reset a revwalk to allow re-configuring it. 4 | 5 | The revwalk is automatically reset when iteration of its commits 6 | completes. 7 | 8 | ## Signature 9 | 10 | ```ts 11 | class Revwalk { 12 | reset(): this; 13 | } 14 | ``` -------------------------------------------------------------------------------- /docs/reference/Revwalk/Methods/simplifyFirstParent.md: -------------------------------------------------------------------------------- 1 | # simplifyFirstParent 2 | 3 | Simplify the history by first-parent. 4 | 5 | No parents other than the first for each commit will be enqueued. 6 | 7 | ## Signature 8 | 9 | ```ts 10 | class Revwalk { 11 | simplifyFirstParent(): this; 12 | } 13 | ``` -------------------------------------------------------------------------------- /docs/reference/Tag/Methods/id.md: -------------------------------------------------------------------------------- 1 | # id 2 | 3 | Get the id (SHA1) of a repository tag. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Tag { 9 | id(): string; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Tag/Methods/message.md: -------------------------------------------------------------------------------- 1 | # message 2 | 3 | Get the message of a tag. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Tag { 9 | message(): string | null; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Tag/Methods/name.md: -------------------------------------------------------------------------------- 1 | # name 2 | 3 | Get the name of a tag. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Tag { 9 | name(): string; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | 22 | 23 | ### Errors 24 | 25 | -------------------------------------------------------------------------------- /docs/reference/Tag/Methods/peel.md: -------------------------------------------------------------------------------- 1 | # peel 2 | 3 | Recursively peel a tag until a non tag Git object is found. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Tag { 9 | peel(): GitObject; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Tag/Methods/target.md: -------------------------------------------------------------------------------- 1 | # target 2 | 3 | Get the tagged object of a tag. 4 | 5 | This method performs a repository lookup for the given object and 6 | returns it. 7 | 8 | ## Signature 9 | 10 | ```ts 11 | class Tag { 12 | target(): GitObject; 13 | } 14 | ``` 15 | 16 | ### Returns 17 | 18 | -------------------------------------------------------------------------------- /docs/reference/Tag/Methods/targetId.md: -------------------------------------------------------------------------------- 1 | # targetId 2 | 3 | Get the OID of the tagged object of a tag. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Tag { 9 | targetId(): string; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Tag/Methods/targetType.md: -------------------------------------------------------------------------------- 1 | # targetType 2 | 3 | Get the ObjectType of the tagged object of a tag. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Tag { 9 | targetType(): ObjectType | null; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Tree/Methods/asObject.md: -------------------------------------------------------------------------------- 1 | # asObject 2 | 3 | Casts this Tree to be usable as an `GitObject`. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Tree { 9 | asObject(): GitObject; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Tree/Methods/get.md: -------------------------------------------------------------------------------- 1 | # get 2 | 3 | Lookup a tree entry by its position in the tree. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Tree { 9 | get(index: number): TreeEntry | null; 10 | } 11 | ``` 12 | 13 | ### Parameters 14 | 15 | 22 | 23 | ### Returns 24 | 25 | -------------------------------------------------------------------------------- /docs/reference/Tree/Methods/getId.md: -------------------------------------------------------------------------------- 1 | # getId 2 | 3 | Lookup a tree entry by SHA value. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Tree { 9 | getId(id: string): TreeEntry | null; 10 | } 11 | ``` 12 | 13 | ### Parameters 14 | 15 | 22 | 23 | ### Returns 24 | 25 | -------------------------------------------------------------------------------- /docs/reference/Tree/Methods/getName.md: -------------------------------------------------------------------------------- 1 | # getName 2 | 3 | Lookup a tree entry by its filename. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Tree { 9 | getName(filename: string): TreeEntry | null; 10 | } 11 | ``` 12 | 13 | ### Parameters 14 | 15 | 22 | 23 | ### Returns 24 | 25 | -------------------------------------------------------------------------------- /docs/reference/Tree/Methods/id.md: -------------------------------------------------------------------------------- 1 | # id 2 | 3 | Get the id (SHA1) of a repository object. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Tree { 9 | id(): string; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Tree/Methods/isEmpty.md: -------------------------------------------------------------------------------- 1 | # isEmpty 2 | 3 | 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Tree { 9 | isEmpty(): boolean; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Tree/Methods/iter.md: -------------------------------------------------------------------------------- 1 | # iter 2 | 3 | Returns an iterator over the entries in this tree. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Tree { 9 | iter(): TreeIter; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Tree/Methods/len.md: -------------------------------------------------------------------------------- 1 | # len 2 | 3 | Get the number of entries listed in this tree. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class Tree { 9 | len(): bigint; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Tree/TreeEntry/filemode.md: -------------------------------------------------------------------------------- 1 | # filemode 2 | 3 | Get the UNIX file attributes of a tree entry. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class TreeEntry { 9 | filemode(): number; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Tree/TreeEntry/id.md: -------------------------------------------------------------------------------- 1 | # id 2 | 3 | Get the id of the object pointed by the entry. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class TreeEntry { 9 | id(): string; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Tree/TreeEntry/name.md: -------------------------------------------------------------------------------- 1 | # name 2 | 3 | Get the filename of a tree entry. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class TreeEntry { 9 | name(): string; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | 22 | 23 | ### Errors 24 | 25 | -------------------------------------------------------------------------------- /docs/reference/Tree/TreeEntry/type.md: -------------------------------------------------------------------------------- 1 | # type 2 | 3 | Get the type of the object pointed by the entry. 4 | 5 | ## Signature 6 | 7 | ```ts 8 | class TreeEntry { 9 | type(): ObjectType | null; 10 | } 11 | ``` 12 | 13 | ### Returns 14 | 15 | -------------------------------------------------------------------------------- /docs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "module": "ESNext", 5 | "moduleResolution": "Bundler", 6 | "skipLibCheck": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | edition = "2021" 2 | max_width = 120 3 | newline_style = "Unix" 4 | reorder_imports = true 5 | reorder_modules = true 6 | tab_spaces = 2 7 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | #![deny(clippy::all)] 2 | 3 | pub mod annotated_commit; 4 | pub mod blame; 5 | pub mod blob; 6 | pub mod branch; 7 | pub mod checkout; 8 | pub mod commit; 9 | pub mod config; 10 | pub mod diff; 11 | mod error; 12 | pub mod ignore; 13 | pub mod index; 14 | pub mod mailmap; 15 | pub mod merge; 16 | pub mod object; 17 | pub mod oid; 18 | pub mod reference; 19 | pub mod remote; 20 | pub mod repository; 21 | pub mod revparse; 22 | pub mod revwalk; 23 | pub mod signature; 24 | pub mod status; 25 | pub mod tag; 26 | pub mod tree; 27 | pub(crate) mod util; 28 | 29 | pub use error::Error; 30 | pub type Result = std::result::Result; 31 | -------------------------------------------------------------------------------- /src/util.rs: -------------------------------------------------------------------------------- 1 | use bitflags::Flags; 2 | use napi::{Env, JsString}; 3 | use std::path::Path; 4 | 5 | pub(crate) fn path_to_js_string(env: &Env, p: &Path) -> crate::Result { 6 | #[cfg(unix)] 7 | { 8 | use std::borrow::Borrow; 9 | 10 | let path = p.to_string_lossy(); 11 | let str = env.create_string(path.borrow())?; 12 | Ok(str) 13 | } 14 | #[cfg(windows)] 15 | { 16 | use std::os::windows::ffi::OsStrExt; 17 | let path_buf = p.as_os_str().encode_wide().collect::>(); 18 | let str = env.create_string_utf16(path_buf.as_slice())?; 19 | Ok(str) 20 | } 21 | } 22 | 23 | pub(crate) fn bitflags_contain(source: T, target: T) -> bool { 24 | source.contains(target) 25 | } 26 | -------------------------------------------------------------------------------- /taplo.toml: -------------------------------------------------------------------------------- 1 | [formatting] 2 | align_entries = true 3 | column_width = 120 4 | reorder_keys = true 5 | -------------------------------------------------------------------------------- /tests/blob.spec.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect, it } from 'vitest'; 2 | import { openRepository } from '../index'; 3 | import { useFixture } from './fixtures'; 4 | 5 | describe('blob', () => { 6 | it('get blob from git object', async () => { 7 | const p = await useFixture('commits'); 8 | const repo = await openRepository(p); 9 | const commit = repo.getCommit('a01e9888e46729ef4aa68953ba19b02a7a64eb82'); 10 | const blob = commit.tree().getName('second')?.toObject(repo)?.peelToBlob(); 11 | expect(blob?.content()).toEqual(new TextEncoder().encode('second\n')); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/COMMIT_EDITMSG: -------------------------------------------------------------------------------- 1 | Add binary file for testing 2 | -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/master 2 | -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/config: -------------------------------------------------------------------------------- 1 | [core] 2 | repositoryformatversion = 0 3 | filemode = true 4 | bare = false 5 | logallrefupdates = true 6 | [user] 7 | name = Seokju Me 8 | email = seokju.na@toss.im 9 | -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/description: -------------------------------------------------------------------------------- 1 | Unnamed repository; edit this file 'description' to name the repository. 2 | -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/blame/_git/index -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/info/exclude: -------------------------------------------------------------------------------- 1 | # git ls-files --others --exclude-from=.git/info/exclude 2 | # Lines that start with '#' are comments. 3 | # For a project mostly in C, the following would be a good set of 4 | # exclude patterns (uncomment them if you want to use them): 5 | # *.[oa] 6 | # *~ 7 | -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/objects/1e/ff732219cdb670957086ef0a9ce3b5dfb3e5ed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/blame/_git/objects/1e/ff732219cdb670957086ef0a9ce3b5dfb3e5ed -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/objects/29/8c79802351105fb1090e9e58709dc293807284: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/blame/_git/objects/29/8c79802351105fb1090e9e58709dc293807284 -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/objects/31/592cf12bf62547f7650d494a21ef13ec948726: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/blame/_git/objects/31/592cf12bf62547f7650d494a21ef13ec948726 -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/objects/4e/923a297834ac3ebcb053955dfa0ba1488a2762: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/blame/_git/objects/4e/923a297834ac3ebcb053955dfa0ba1488a2762 -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/objects/51/029f41467b9e0da8eead9fd315936b29372ec5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/blame/_git/objects/51/029f41467b9e0da8eead9fd315936b29372ec5 -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/objects/57/2d5d94839464f28ef959932515ee6624dbfe01: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/blame/_git/objects/57/2d5d94839464f28ef959932515ee6624dbfe01 -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/objects/6a/8003da91eb8b81eda9fa60829281f40dfdb895: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/blame/_git/objects/6a/8003da91eb8b81eda9fa60829281f40dfdb895 -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/objects/78/533417a7d9664edc748a5ebfe4e4597a04b102: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/blame/_git/objects/78/533417a7d9664edc748a5ebfe4e4597a04b102 -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/objects/7d/65b5023dd21f6b6a280c92471f0bfcc9205854: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/blame/_git/objects/7d/65b5023dd21f6b6a280c92471f0bfcc9205854 -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/objects/a1/ac638d28a809a53771fb4508fc955c850a6563: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/blame/_git/objects/a1/ac638d28a809a53771fb4508fc955c850a6563 -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/objects/a4/187e439680498bd49c7d1623b345853b315d24: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/blame/_git/objects/a4/187e439680498bd49c7d1623b345853b315d24 -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/objects/a4/835a824b0e13a5d8e6c3fc2efe11b19db2f572: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/blame/_git/objects/a4/835a824b0e13a5d8e6c3fc2efe11b19db2f572 -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/objects/bf/919193432351369043c79546ebef2f2c0ae88c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/blame/_git/objects/bf/919193432351369043c79546ebef2f2c0ae88c -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/objects/d6/d06d4a464c95a883224920131051f9c6958a22: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/blame/_git/objects/d6/d06d4a464c95a883224920131051f9c6958a22 -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/objects/e4/ef0685ef71b4a7902b17bc1e2386413520af52: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/blame/_git/objects/e4/ef0685ef71b4a7902b17bc1e2386413520af52 -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/blame/_git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/objects/f5/001ea2983a7aef4f79b515e4886b493bdf6894: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/blame/_git/objects/f5/001ea2983a7aef4f79b515e4886b493bdf6894 -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/objects/fa/9312f17690054007c8325ebdd402163fac01dd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/blame/_git/objects/fa/9312f17690054007c8325ebdd402163fac01dd -------------------------------------------------------------------------------- /tests/fixtures/blame/_git/refs/heads/master: -------------------------------------------------------------------------------- 1 | 1eff732219cdb670957086ef0a9ce3b5dfb3e5ed 2 | -------------------------------------------------------------------------------- /tests/fixtures/blame/binary_file: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/blame/binary_file -------------------------------------------------------------------------------- /tests/fixtures/blame/blame: -------------------------------------------------------------------------------- 1 | Line 1 2 | Line 2 modified by Seokju Me 3 | Line 3 4 | Line 4 5 | Line 5 6 | Line 6 7 | Line 7 modified by Seokju Me 8 | Line 8 9 | Line 9 modified by Seokju Me 10 | Line 10 11 | -------------------------------------------------------------------------------- /tests/fixtures/blame/empty_file: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/blame/empty_file -------------------------------------------------------------------------------- /tests/fixtures/commits/_git/COMMIT_EDITMSG: -------------------------------------------------------------------------------- 1 | second 2 | -------------------------------------------------------------------------------- /tests/fixtures/commits/_git/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/main 2 | -------------------------------------------------------------------------------- /tests/fixtures/commits/_git/config: -------------------------------------------------------------------------------- 1 | [core] 2 | repositoryformatversion = 0 3 | filemode = true 4 | bare = false 5 | logallrefupdates = true 6 | ignorecase = true 7 | precomposeunicode = true 8 | -------------------------------------------------------------------------------- /tests/fixtures/commits/_git/description: -------------------------------------------------------------------------------- 1 | Unnamed repository; edit this file 'description' to name the repository. 2 | -------------------------------------------------------------------------------- /tests/fixtures/commits/_git/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/commits/_git/index -------------------------------------------------------------------------------- /tests/fixtures/commits/_git/info/exclude: -------------------------------------------------------------------------------- 1 | # git ls-files --others --exclude-from=.git/info/exclude 2 | # Lines that start with '#' are comments. 3 | # For a project mostly in C, the following would be a good set of 4 | # exclude patterns (uncomment them if you want to use them): 5 | # *.[oa] 6 | # *~ 7 | -------------------------------------------------------------------------------- /tests/fixtures/commits/_git/objects/88/7efe1f5b0db9f180f98ad6958ee2e0aee198c1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/commits/_git/objects/88/7efe1f5b0db9f180f98ad6958ee2e0aee198c1 -------------------------------------------------------------------------------- /tests/fixtures/commits/_git/objects/9c/59e24b8393179a5d712de4f990178df5734d99: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/commits/_git/objects/9c/59e24b8393179a5d712de4f990178df5734d99 -------------------------------------------------------------------------------- /tests/fixtures/commits/_git/objects/a0/1e9888e46729ef4aa68953ba19b02a7a64eb82: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/commits/_git/objects/a0/1e9888e46729ef4aa68953ba19b02a7a64eb82 -------------------------------------------------------------------------------- /tests/fixtures/commits/_git/objects/b3/3e0101b828225f77eeff4dfa31259dcf379002: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/commits/_git/objects/b3/3e0101b828225f77eeff4dfa31259dcf379002 -------------------------------------------------------------------------------- /tests/fixtures/commits/_git/objects/d0/50db98b2b6674b8d65d73dde50e6e52c2c319d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/commits/_git/objects/d0/50db98b2b6674b8d65d73dde50e6e52c2c319d -------------------------------------------------------------------------------- /tests/fixtures/commits/_git/objects/e0/19be006cf33489e2d0177a3837a2384eddebc5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/commits/_git/objects/e0/19be006cf33489e2d0177a3837a2384eddebc5 -------------------------------------------------------------------------------- /tests/fixtures/commits/_git/refs/heads/main: -------------------------------------------------------------------------------- 1 | a01e9888e46729ef4aa68953ba19b02a7a64eb82 2 | -------------------------------------------------------------------------------- /tests/fixtures/commits/first: -------------------------------------------------------------------------------- 1 | first 2 | -------------------------------------------------------------------------------- /tests/fixtures/commits/second: -------------------------------------------------------------------------------- 1 | second 2 | -------------------------------------------------------------------------------- /tests/fixtures/diff/A: -------------------------------------------------------------------------------- 1 | A 2 | -------------------------------------------------------------------------------- /tests/fixtures/diff/B: -------------------------------------------------------------------------------- 1 | B 2 | -------------------------------------------------------------------------------- /tests/fixtures/diff/C: -------------------------------------------------------------------------------- 1 | C 2 | -------------------------------------------------------------------------------- /tests/fixtures/diff/_git/COMMIT_EDITMSG: -------------------------------------------------------------------------------- 1 | C 2 | -------------------------------------------------------------------------------- /tests/fixtures/diff/_git/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/main 2 | -------------------------------------------------------------------------------- /tests/fixtures/diff/_git/config: -------------------------------------------------------------------------------- 1 | [core] 2 | repositoryformatversion = 0 3 | filemode = true 4 | bare = false 5 | logallrefupdates = true 6 | ignorecase = true 7 | precomposeunicode = true 8 | autocrlf = false 9 | eol = lf 10 | -------------------------------------------------------------------------------- /tests/fixtures/diff/_git/description: -------------------------------------------------------------------------------- 1 | Unnamed repository; edit this file 'description' to name the repository. 2 | -------------------------------------------------------------------------------- /tests/fixtures/diff/_git/hooks/applypatch-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message taken by 4 | # applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. The hook is 8 | # allowed to edit the commit message file. 9 | # 10 | # To enable this hook, rename this file to "applypatch-msg". 11 | 12 | . git-sh-setup 13 | commitmsg="$(git rev-parse --git-path hooks/commit-msg)" 14 | test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} 15 | : 16 | -------------------------------------------------------------------------------- /tests/fixtures/diff/_git/hooks/post-update.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to prepare a packed repository for use over 4 | # dumb transports. 5 | # 6 | # To enable this hook, rename this file to "post-update". 7 | 8 | exec git update-server-info 9 | -------------------------------------------------------------------------------- /tests/fixtures/diff/_git/hooks/pre-applypatch.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to verify what is about to be committed 4 | # by applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. 8 | # 9 | # To enable this hook, rename this file to "pre-applypatch". 10 | 11 | . git-sh-setup 12 | precommit="$(git rev-parse --git-path hooks/pre-commit)" 13 | test -x "$precommit" && exec "$precommit" ${1+"$@"} 14 | : 15 | -------------------------------------------------------------------------------- /tests/fixtures/diff/_git/hooks/pre-merge-commit.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to verify what is about to be committed. 4 | # Called by "git merge" with no arguments. The hook should 5 | # exit with non-zero status after issuing an appropriate message to 6 | # stderr if it wants to stop the merge commit. 7 | # 8 | # To enable this hook, rename this file to "pre-merge-commit". 9 | 10 | . git-sh-setup 11 | test -x "$GIT_DIR/hooks/pre-commit" && 12 | exec "$GIT_DIR/hooks/pre-commit" 13 | : 14 | -------------------------------------------------------------------------------- /tests/fixtures/diff/_git/hooks/pre-receive.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to make use of push options. 4 | # The example simply echoes all push options that start with 'echoback=' 5 | # and rejects all pushes when the "reject" push option is used. 6 | # 7 | # To enable this hook, rename this file to "pre-receive". 8 | 9 | if test -n "$GIT_PUSH_OPTION_COUNT" 10 | then 11 | i=0 12 | while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" 13 | do 14 | eval "value=\$GIT_PUSH_OPTION_$i" 15 | case "$value" in 16 | echoback=*) 17 | echo "echo from the pre-receive-hook: ${value#*=}" >&2 18 | ;; 19 | reject) 20 | exit 1 21 | esac 22 | i=$((i + 1)) 23 | done 24 | fi 25 | -------------------------------------------------------------------------------- /tests/fixtures/diff/_git/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/diff/_git/index -------------------------------------------------------------------------------- /tests/fixtures/diff/_git/info/exclude: -------------------------------------------------------------------------------- 1 | # git ls-files --others --exclude-from=.git/info/exclude 2 | # Lines that start with '#' are comments. 3 | # For a project mostly in C, the following would be a good set of 4 | # exclude patterns (uncomment them if you want to use them): 5 | # *.[oa] 6 | # *~ 7 | -------------------------------------------------------------------------------- /tests/fixtures/diff/_git/objects/04/de102240808ce1c40275c24da02ce57ccf5a41: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/diff/_git/objects/04/de102240808ce1c40275c24da02ce57ccf5a41 -------------------------------------------------------------------------------- /tests/fixtures/diff/_git/objects/08/d22387db701fecc810c2f64828f93fedcf5c3e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/diff/_git/objects/08/d22387db701fecc810c2f64828f93fedcf5c3e -------------------------------------------------------------------------------- /tests/fixtures/diff/_git/objects/1d/58c101b252a96865788a0749114f537cd96a05: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/diff/_git/objects/1d/58c101b252a96865788a0749114f537cd96a05 -------------------------------------------------------------------------------- /tests/fixtures/diff/_git/objects/22/3b7836fb19fdf64ba2d3cd6173c6a283141f78: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/diff/_git/objects/22/3b7836fb19fdf64ba2d3cd6173c6a283141f78 -------------------------------------------------------------------------------- /tests/fixtures/diff/_git/objects/3c/c58df83752123644fef39faab2393af643b1d2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/diff/_git/objects/3c/c58df83752123644fef39faab2393af643b1d2 -------------------------------------------------------------------------------- /tests/fixtures/diff/_git/objects/46/93c6b85469102ed0174757f42d9c8806c687fb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/diff/_git/objects/46/93c6b85469102ed0174757f42d9c8806c687fb -------------------------------------------------------------------------------- /tests/fixtures/diff/_git/objects/da/459f1d2a9b6bd95530d74c707954b757288479: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/diff/_git/objects/da/459f1d2a9b6bd95530d74c707954b757288479 -------------------------------------------------------------------------------- /tests/fixtures/diff/_git/objects/f5/3c91092dbda83f3565e78c285f3e2ab0cfd968: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/diff/_git/objects/f5/3c91092dbda83f3565e78c285f3e2ab0cfd968 -------------------------------------------------------------------------------- /tests/fixtures/diff/_git/objects/f7/0f10e4db19068f79bc43844b49f3eece45c4e8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/diff/_git/objects/f7/0f10e4db19068f79bc43844b49f3eece45c4e8 -------------------------------------------------------------------------------- /tests/fixtures/diff/_git/refs/heads/main: -------------------------------------------------------------------------------- 1 | da459f1d2a9b6bd95530d74c707954b757288479 2 | -------------------------------------------------------------------------------- /tests/fixtures/empty/_git/COMMIT_EDITMSG: -------------------------------------------------------------------------------- 1 | init 2 | -------------------------------------------------------------------------------- /tests/fixtures/empty/_git/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/main 2 | -------------------------------------------------------------------------------- /tests/fixtures/empty/_git/config: -------------------------------------------------------------------------------- 1 | [core] 2 | repositoryformatversion = 0 3 | filemode = true 4 | bare = false 5 | logallrefupdates = true 6 | ignorecase = true 7 | precomposeunicode = true 8 | -------------------------------------------------------------------------------- /tests/fixtures/empty/_git/description: -------------------------------------------------------------------------------- 1 | Unnamed repository; edit this file 'description' to name the repository. 2 | -------------------------------------------------------------------------------- /tests/fixtures/empty/_git/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/empty/_git/index -------------------------------------------------------------------------------- /tests/fixtures/empty/_git/info/exclude: -------------------------------------------------------------------------------- 1 | # git ls-files --others --exclude-from=.git/info/exclude 2 | # Lines that start with '#' are comments. 3 | # For a project mostly in C, the following would be a good set of 4 | # exclude patterns (uncomment them if you want to use them): 5 | # *.[oa] 6 | # *~ 7 | -------------------------------------------------------------------------------- /tests/fixtures/empty/_git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904: -------------------------------------------------------------------------------- 1 | x+)JMU0` 2 | , -------------------------------------------------------------------------------- /tests/fixtures/empty/_git/objects/69/28d1d00de602d8ba53603574237ab499467c29: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/empty/_git/objects/69/28d1d00de602d8ba53603574237ab499467c29 -------------------------------------------------------------------------------- /tests/fixtures/empty/_git/refs/heads/main: -------------------------------------------------------------------------------- 1 | 6928d1d00de602d8ba53603574237ab499467c29 2 | -------------------------------------------------------------------------------- /tests/fixtures/mailmap/.mailmap: -------------------------------------------------------------------------------- 1 | Seokju Me Seokju Na -------------------------------------------------------------------------------- /tests/fixtures/mailmap/_git/COMMIT_EDITMSG: -------------------------------------------------------------------------------- 1 | Add mailmap file 2 | -------------------------------------------------------------------------------- /tests/fixtures/mailmap/_git/FETCH_HEAD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/mailmap/_git/FETCH_HEAD -------------------------------------------------------------------------------- /tests/fixtures/mailmap/_git/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/main 2 | -------------------------------------------------------------------------------- /tests/fixtures/mailmap/_git/config: -------------------------------------------------------------------------------- 1 | [core] 2 | repositoryformatversion = 0 3 | filemode = false 4 | bare = false 5 | logallrefupdates = true 6 | ignorecase = true 7 | [user] 8 | name = Seokju Na 9 | email = seokju.me@gmail.com 10 | -------------------------------------------------------------------------------- /tests/fixtures/mailmap/_git/description: -------------------------------------------------------------------------------- 1 | Unnamed repository; edit this file 'description' to name the repository. 2 | -------------------------------------------------------------------------------- /tests/fixtures/mailmap/_git/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/mailmap/_git/index -------------------------------------------------------------------------------- /tests/fixtures/mailmap/_git/info/exclude: -------------------------------------------------------------------------------- 1 | # git ls-files --others --exclude-from=.git/info/exclude 2 | # Lines that start with '#' are comments. 3 | # For a project mostly in C, the following would be a good set of 4 | # exclude patterns (uncomment them if you want to use them): 5 | # *.[oa] 6 | # *~ 7 | -------------------------------------------------------------------------------- /tests/fixtures/mailmap/_git/objects/19/9c187284140bcbbc349b06929cc3b353f393a5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/mailmap/_git/objects/19/9c187284140bcbbc349b06929cc3b353f393a5 -------------------------------------------------------------------------------- /tests/fixtures/mailmap/_git/objects/31/c3baad252081eabdbbcc92d0a143db6b5b545a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/mailmap/_git/objects/31/c3baad252081eabdbbcc92d0a143db6b5b545a -------------------------------------------------------------------------------- /tests/fixtures/mailmap/_git/objects/4c/276ac01f35c6bdc471ad6936e5f361934b1994: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/mailmap/_git/objects/4c/276ac01f35c6bdc471ad6936e5f361934b1994 -------------------------------------------------------------------------------- /tests/fixtures/mailmap/_git/objects/50/e6b05d9c524a8f37dda88cd8a1b6502f0e3f2a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/mailmap/_git/objects/50/e6b05d9c524a8f37dda88cd8a1b6502f0e3f2a -------------------------------------------------------------------------------- /tests/fixtures/mailmap/_git/objects/c5/9a21bfce35ee0016a4cd87feb96ed326d271af: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/mailmap/_git/objects/c5/9a21bfce35ee0016a4cd87feb96ed326d271af -------------------------------------------------------------------------------- /tests/fixtures/mailmap/_git/objects/d5/2a2440dfd44f7b541c3811b10789537efe94af: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/mailmap/_git/objects/d5/2a2440dfd44f7b541c3811b10789537efe94af -------------------------------------------------------------------------------- /tests/fixtures/mailmap/_git/objects/d9/21dc0ceae0d1f011600ea92c1bfd1f21ae16a6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/mailmap/_git/objects/d9/21dc0ceae0d1f011600ea92c1bfd1f21ae16a6 -------------------------------------------------------------------------------- /tests/fixtures/mailmap/_git/refs/heads/main: -------------------------------------------------------------------------------- 1 | 50e6b05d9c524a8f37dda88cd8a1b6502f0e3f2a 2 | -------------------------------------------------------------------------------- /tests/fixtures/notgit/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/notgit/.gitkeep -------------------------------------------------------------------------------- /tests/fixtures/revparse/_git/COMMIT_EDITMSG: -------------------------------------------------------------------------------- 1 | other-2 2 | -------------------------------------------------------------------------------- /tests/fixtures/revparse/_git/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/main 2 | -------------------------------------------------------------------------------- /tests/fixtures/revparse/_git/config: -------------------------------------------------------------------------------- 1 | [core] 2 | repositoryformatversion = 0 3 | filemode = true 4 | bare = false 5 | logallrefupdates = true 6 | ignorecase = true 7 | precomposeunicode = true 8 | -------------------------------------------------------------------------------- /tests/fixtures/revparse/_git/description: -------------------------------------------------------------------------------- 1 | Unnamed repository; edit this file 'description' to name the repository. 2 | -------------------------------------------------------------------------------- /tests/fixtures/revparse/_git/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/revparse/_git/index -------------------------------------------------------------------------------- /tests/fixtures/revparse/_git/info/exclude: -------------------------------------------------------------------------------- 1 | # git ls-files --others --exclude-from=.git/info/exclude 2 | # Lines that start with '#' are comments. 3 | # For a project mostly in C, the following would be a good set of 4 | # exclude patterns (uncomment them if you want to use them): 5 | # *.[oa] 6 | # *~ 7 | -------------------------------------------------------------------------------- /tests/fixtures/revparse/_git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904: -------------------------------------------------------------------------------- 1 | x+)JMU0` 2 | , -------------------------------------------------------------------------------- /tests/fixtures/revparse/_git/objects/60/10700f61fe03e4bdf3814fa9ba2cdbcea0ddec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/revparse/_git/objects/60/10700f61fe03e4bdf3814fa9ba2cdbcea0ddec -------------------------------------------------------------------------------- /tests/fixtures/revparse/_git/objects/a5/fd9e1400af677d54a665dee953c7bde1daaaab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/revparse/_git/objects/a5/fd9e1400af677d54a665dee953c7bde1daaaab -------------------------------------------------------------------------------- /tests/fixtures/revparse/_git/objects/b5/80e5f5030f508a3658a4155f44cdd9754950c5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/revparse/_git/objects/b5/80e5f5030f508a3658a4155f44cdd9754950c5 -------------------------------------------------------------------------------- /tests/fixtures/revparse/_git/objects/ec/ec200b27c181b64545bd03f99e995768289d4f: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/revparse/_git/objects/ec/ec200b27c181b64545bd03f99e995768289d4f -------------------------------------------------------------------------------- /tests/fixtures/revparse/_git/refs/heads/main: -------------------------------------------------------------------------------- 1 | ecec200b27c181b64545bd03f99e995768289d4f 2 | -------------------------------------------------------------------------------- /tests/fixtures/revparse/_git/refs/heads/other: -------------------------------------------------------------------------------- 1 | b580e5f5030f508a3658a4155f44cdd9754950c5 2 | -------------------------------------------------------------------------------- /tests/fixtures/tag/A: -------------------------------------------------------------------------------- 1 | A 2 | -------------------------------------------------------------------------------- /tests/fixtures/tag/B: -------------------------------------------------------------------------------- 1 | B 2 | -------------------------------------------------------------------------------- /tests/fixtures/tag/C: -------------------------------------------------------------------------------- 1 | C 2 | -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/COMMIT_EDITMSG: -------------------------------------------------------------------------------- 1 | C 2 | -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/main 2 | -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/config: -------------------------------------------------------------------------------- 1 | [core] 2 | repositoryformatversion = 0 3 | filemode = true 4 | bare = false 5 | logallrefupdates = true 6 | ignorecase = true 7 | precomposeunicode = true 8 | -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/description: -------------------------------------------------------------------------------- 1 | Unnamed repository; edit this file 'description' to name the repository. 2 | -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/hooks/applypatch-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message taken by 4 | # applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. The hook is 8 | # allowed to edit the commit message file. 9 | # 10 | # To enable this hook, rename this file to "applypatch-msg". 11 | 12 | . git-sh-setup 13 | commitmsg="$(git rev-parse --git-path hooks/commit-msg)" 14 | test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} 15 | : 16 | -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/hooks/post-update.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to prepare a packed repository for use over 4 | # dumb transports. 5 | # 6 | # To enable this hook, rename this file to "post-update". 7 | 8 | exec git update-server-info 9 | -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/hooks/pre-applypatch.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to verify what is about to be committed 4 | # by applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. 8 | # 9 | # To enable this hook, rename this file to "pre-applypatch". 10 | 11 | . git-sh-setup 12 | precommit="$(git rev-parse --git-path hooks/pre-commit)" 13 | test -x "$precommit" && exec "$precommit" ${1+"$@"} 14 | : 15 | -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/hooks/pre-merge-commit.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to verify what is about to be committed. 4 | # Called by "git merge" with no arguments. The hook should 5 | # exit with non-zero status after issuing an appropriate message to 6 | # stderr if it wants to stop the merge commit. 7 | # 8 | # To enable this hook, rename this file to "pre-merge-commit". 9 | 10 | . git-sh-setup 11 | test -x "$GIT_DIR/hooks/pre-commit" && 12 | exec "$GIT_DIR/hooks/pre-commit" 13 | : 14 | -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/hooks/pre-receive.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to make use of push options. 4 | # The example simply echoes all push options that start with 'echoback=' 5 | # and rejects all pushes when the "reject" push option is used. 6 | # 7 | # To enable this hook, rename this file to "pre-receive". 8 | 9 | if test -n "$GIT_PUSH_OPTION_COUNT" 10 | then 11 | i=0 12 | while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" 13 | do 14 | eval "value=\$GIT_PUSH_OPTION_$i" 15 | case "$value" in 16 | echoback=*) 17 | echo "echo from the pre-receive-hook: ${value#*=}" >&2 18 | ;; 19 | reject) 20 | exit 1 21 | esac 22 | i=$((i + 1)) 23 | done 24 | fi 25 | -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/tag/_git/index -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/info/exclude: -------------------------------------------------------------------------------- 1 | # git ls-files --others --exclude-from=.git/info/exclude 2 | # Lines that start with '#' are comments. 3 | # For a project mostly in C, the following would be a good set of 4 | # exclude patterns (uncomment them if you want to use them): 5 | # *.[oa] 6 | # *~ 7 | -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/objects/04/de102240808ce1c40275c24da02ce57ccf5a41: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/tag/_git/objects/04/de102240808ce1c40275c24da02ce57ccf5a41 -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/objects/1d/58c101b252a96865788a0749114f537cd96a05: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/tag/_git/objects/1d/58c101b252a96865788a0749114f537cd96a05 -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/objects/22/3b7836fb19fdf64ba2d3cd6173c6a283141f78: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/tag/_git/objects/22/3b7836fb19fdf64ba2d3cd6173c6a283141f78 -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/objects/26/cf7ebc61494e892188a3ceab38702b2ecdc353: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/tag/_git/objects/26/cf7ebc61494e892188a3ceab38702b2ecdc353 -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/objects/3c/c58df83752123644fef39faab2393af643b1d2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/tag/_git/objects/3c/c58df83752123644fef39faab2393af643b1d2 -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/objects/41/1412e7676a1249e429b34d4f3ab1229b3d5e8e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/tag/_git/objects/41/1412e7676a1249e429b34d4f3ab1229b3d5e8e -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/objects/56/7aa5c6b219312dc7758ab88ebb7a1e5d36d26b: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/tag/_git/objects/56/7aa5c6b219312dc7758ab88ebb7a1e5d36d26b -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/objects/67/4e3327707fcf32a348ecfc0cb6b93e57398b8c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/tag/_git/objects/67/4e3327707fcf32a348ecfc0cb6b93e57398b8c -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/objects/82/8954df9f08dc8e172447cdacf0ddea1adf9e63: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/tag/_git/objects/82/8954df9f08dc8e172447cdacf0ddea1adf9e63 -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/objects/aa/0040546ed22b8bb33f3bd621e8d10ed849b02c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/tag/_git/objects/aa/0040546ed22b8bb33f3bd621e8d10ed849b02c -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/objects/f5/3c91092dbda83f3565e78c285f3e2ab0cfd968: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/tag/_git/objects/f5/3c91092dbda83f3565e78c285f3e2ab0cfd968 -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/objects/f7/0f10e4db19068f79bc43844b49f3eece45c4e8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toss/es-git/255ca4fdb24a97a7e4ff53c3c214e0eb779c4955/tests/fixtures/tag/_git/objects/f7/0f10e4db19068f79bc43844b49f3eece45c4e8 -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/refs/heads/main: -------------------------------------------------------------------------------- 1 | 26cf7ebc61494e892188a3ceab38702b2ecdc353 2 | -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/refs/tags/v0: -------------------------------------------------------------------------------- 1 | aa0040546ed22b8bb33f3bd621e8d10ed849b02c 2 | -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/refs/tags/v1: -------------------------------------------------------------------------------- 1 | 674e3327707fcf32a348ecfc0cb6b93e57398b8c 2 | -------------------------------------------------------------------------------- /tests/fixtures/tag/_git/refs/tags/v2: -------------------------------------------------------------------------------- 1 | 567aa5c6b219312dc7758ab88ebb7a1e5d36d26b 2 | -------------------------------------------------------------------------------- /tests/signature.spec.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect, it } from 'vitest'; 2 | import { createSignature } from '../index'; 3 | 4 | describe('signature', () => { 5 | it('create signature', () => { 6 | const sig = createSignature('Seokju Na', 'seokju.me@toss.im'); 7 | expect(sig.name).toEqual('Seokju Na'); 8 | expect(sig.email).toEqual('seokju.me@toss.im'); 9 | }); 10 | 11 | it('create signature with timestamp', () => { 12 | const sig = createSignature('Seokju Na', 'seokju.me@toss.im', { 13 | timestamp: 1734280068, 14 | }); 15 | expect(sig.timestamp).toEqual(1734280068); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /tests/tree.spec.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect, it, vi } from 'vitest'; 2 | import { openRepository } from '../index'; 3 | import { useFixture } from './fixtures'; 4 | 5 | describe('tree', () => { 6 | it('walk tree', async () => { 7 | const p = await useFixture('commits'); 8 | const repo = await openRepository(p); 9 | const commit = repo.getCommit('a01e9888e46729ef4aa68953ba19b02a7a64eb82'); 10 | const tree = commit.tree(); 11 | const walk = vi.fn(); 12 | tree.walk('PreOrder', entry => { 13 | walk(entry.name(), entry.id(), entry.type()); 14 | return 0; 15 | }); 16 | expect(walk.mock.calls).toEqual([ 17 | ['first', '9c59e24b8393179a5d712de4f990178df5734d99', 'Blob'], 18 | ['second', 'e019be006cf33489e2d0177a3837a2384eddebc5', 'Blob'], 19 | ]); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /tests/types.ts: -------------------------------------------------------------------------------- 1 | export type FlattenMethods = { 2 | [K in keyof T]: T[K] extends (...args: any[]) => infer R ? (R extends object ? FlattenMethods : R) : T[K]; 3 | }; 4 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "target": "ESNext", 5 | "module": "ESNext", 6 | "moduleResolution": "bundler", 7 | "strict": true, 8 | "noFallthroughCasesInSwitch": true, 9 | "noUncheckedIndexedAccess": true, 10 | "noUnusedParameters": true, 11 | "forceConsistentCasingInFileNames": true, 12 | "lib": ["ESNext", "DOM", "DOM.Iterable"], 13 | "noEmit": true, 14 | "allowSyntheticDefaultImports": true, 15 | "esModuleInterop": true, 16 | "skipLibCheck": true, 17 | "resolveJsonModule": true 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "git": { 3 | "deploymentEnabled": { 4 | "main": false 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /vitest.config.mts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | environment: 'node', 6 | clearMocks: true, 7 | testTimeout: 60_000, 8 | }, 9 | }); 10 | --------------------------------------------------------------------------------