Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/ko/reference/Commit/Methods/treeId.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# treeId

이 커밋이 가리키는 트리의 ID를 가져와요.

ODB에서 Git 개체를 가져오기 위한 시도는 하지 않아요.

## 시그니처

```ts
class Commit {
treeId(): string;
}
```

### 반환 값

<ul class="param-ul">
<li class="param-li param-li-root">
<span class="param-type">string</span>
<br>
<p class="param-description">커밋이 가리키는 트리의 ID 값</p>
</li>
</ul>
23 changes: 23 additions & 0 deletions docs/reference/Commit/Methods/treeId.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# treeId

Get the id of the tree pointed to by this commit.

No attempts are made to fetch an object from the ODB.

## Signature

```ts
class Commit {
treeId(): string;
}
```

### Returns

<ul class="param-ul">
<li class="param-li param-li-root">
<span class="param-type">string</span>
<br>
<p class="param-description">Get the id of the tree pointed to by a commit.</p>
</li>
</ul>
19 changes: 19 additions & 0 deletions src/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,25 @@ impl Commit {
Ok(time)
}

#[napi]
/// Get the id of the tree pointed to by this commit.
///
/// No attempts are made to fetch an object from the ODB.
///
/// @category Commit/Methods
///
/// @signature
/// ```ts
/// class Commit {
/// treeId(): string;
/// }
/// ```
///
/// @returns Get the id of the tree pointed to by a commit.
pub fn tree_id(&self) -> String {
self.inner.tree_id().to_string()
}

#[napi]
/// Get the tree pointed to by a commit.
///
Expand Down