Skip to content

Commit c88be6b

Browse files
authored
docs(repository): add missing documentations for repository (#58)
1 parent 8890db0 commit c88be6b

File tree

20 files changed

+623
-19
lines changed

20 files changed

+623
-19
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# head
2+
3+
`HEAD`가 가리키는 레퍼런스를 가져와요.
4+
5+
## 시그니처
6+
7+
```ts
8+
class Repository {
9+
head(): Reference;
10+
}
11+
```
12+
13+
### 반환 값
14+
15+
<ul class="param-ul">
16+
<li class="param-li param-li-root">
17+
<span class="param-type">레퍼런스</span>
18+
<br>
19+
<p class="param-description">
20+
<code>HEAD</code>가 가리키는 레퍼런스를 반환해요.
21+
</p>
22+
</li>
23+
</ul>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# isBare
2+
3+
이 리포지토리가 `bare` 리포지토리인지 확인해요.
4+
5+
## 시그니처
6+
7+
```ts
8+
class Repository {
9+
isBare(): boolean;
10+
}
11+
```
12+
13+
### 반환 값
14+
15+
<ul class="param-ul">
16+
<li class="param-li param-li-root">
17+
<span class="param-type">boolean</span>
18+
<br>
19+
<p class="param-description">리포지토리가 <code>bare</code> 리포지토리이면 <code>true</code>를 반환해요.</p>
20+
</li>
21+
</ul>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# isEmpty
2+
3+
이 리포지토리가 비어 있는지 확인해요.
4+
5+
## 시그니처
6+
7+
```ts
8+
class Repository {
9+
isEmpty(): boolean;
10+
}
11+
```
12+
13+
### 반환 값
14+
15+
<ul class="param-ul">
16+
<li class="param-li param-li-root">
17+
<span class="param-type">boolean</span>
18+
<br>
19+
<p class="param-description">리포지토리가 비어 있으면 <code>true</code>를 반환해요.</p>
20+
</li>
21+
</ul>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# isShallow
2+
3+
이 리포지토리가 얕은 클론(shallow clone)인지 확인해요.
4+
5+
## 시그니처
6+
7+
```ts
8+
class Repository {
9+
isShallow(): boolean;
10+
}
11+
```
12+
13+
### 반환 값
14+
15+
<ul class="param-ul">
16+
<li class="param-li param-li-root">
17+
<span class="param-type">boolean</span>
18+
<br>
19+
<p class="param-description">리포지토리가 얕은 클론이면 <code>true</code>를 반환해요.</p>
20+
</li>
21+
</ul>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# isWorktree
2+
3+
이 리포지토리가 작업 트리(worktree)인지 확인해요.
4+
5+
## 시그니처
6+
7+
```ts
8+
class Repository {
9+
isWorktree(): boolean;
10+
}
11+
```
12+
13+
### 반환 값
14+
15+
<ul class="param-ul">
16+
<li class="param-li param-li-root">
17+
<span class="param-type">boolean</span>
18+
<br>
19+
<p class="param-description">리포지토리가 작업 트리이면 <code>true</code>를 반환해요.</p>
20+
</li>
21+
</ul>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# path
2+
3+
일반 리포지토리의 경우 `.git` 폴더의 경로를 반환하고, `bare` 리포지토리의 경우 리포지토리 자체의 경로를 반환해요.
4+
5+
## 시그니처
6+
7+
```ts
8+
class Repository {
9+
path(): string;
10+
}
11+
```
12+
13+
### 반환 값
14+
15+
<ul class="param-ul">
16+
<li class="param-li param-li-root">
17+
<span class="param-type">string</span>
18+
<br>
19+
<p class="param-description">일반 리포지토리의 경우 <code>.git</code> 폴더의 경로를 반환하고, <code>bare</code> 리포지토리의 경우 리포지토리 자체의 경로를 반환해요.</p>
20+
</li>
21+
</ul>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# setHead
2+
3+
리포지토리의 `HEAD`를 지정된 레퍼런스로 변경해요.
4+
5+
- 지정된 레퍼런스가 트리(tree)나 블롭(blob)을 가리키면 `HEAD`는 변경되지 않고, 에러가 발생해요.
6+
- 지정된 레퍼런스가 브랜치를 가리키면 `HEAD`는 해당 브랜치를 가리키게 돼요.
7+
- 이미 브랜치에 연결된 상태라면 그대로 유지돼요.
8+
- 기존에 연결되지 않은 상태였다면 연결돼요.
9+
- 브랜치가 아직 존재하지 않아도 에러가 발생하지 않으며, `HEAD`는 생성되지 않은 브랜치를 가리키게 돼요.
10+
- 위 조건에 해당하지 않으면 `HEAD`는 분리 상태가 되어 특정 커밋을 직접 가리켜요.
11+
12+
## 시그니처
13+
14+
```ts
15+
class Repository {
16+
setHead(refname: string): void;
17+
}
18+
```
19+
20+
### 파라미터
21+
22+
<ul class="param-ul">
23+
<li class="param-li param-li-root">
24+
<span class="param-name">refname</span><span class="param-required">required</span>&nbsp;·&nbsp;<span class="param-type">string</span>
25+
<br>
26+
<p class="param-description"><code>HEAD</code>가 가리킬 레퍼런스를 지정해요.</p>
27+
</li>
28+
</ul>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# state
2+
3+
현재 리포지토리의 상태를 반환해요.
4+
5+
## 시그니처
6+
7+
```ts
8+
class Repository {
9+
state(): RepositoryState;
10+
}
11+
```
12+
13+
### 반환 값
14+
15+
<ul class="param-ul">
16+
<li class="param-li param-li-root">
17+
<span class="param-type">RepositoryState</span>
18+
<br>
19+
<p class="param-description">현재 리포지토리의 상태를 반환해요.</p>
20+
<p class="param-description">사용 가능한 상태는 다음과 같아요:
21+
<code>Clean</code>, <code>Merge</code>, <code>Revert</code>, <code>RevertSequence</code>, <code>CherryPick</code>,<br>
22+
<code>CherryPickSequence</code>, <code>Bisect</code>, <code>Rebase</code>, <code>RebaseInteractive</code>, <code>RebaseMerge</code>,<br>
23+
<code>ApplyMailbox</code>, <code>ApplyMailboxOrRebase</code>.</p>
24+
</li>
25+
</ul>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# workdir
2+
3+
현재 리포지토리의 작업 디렉터리 경로를 가져와요.
4+
5+
## 시그니처
6+
7+
```ts
8+
class Repository {
9+
workdir(): string | null;
10+
}
11+
```
12+
13+
### 반환 값
14+
15+
<ul class="param-ul">
16+
<li class="param-li param-li-root">
17+
<span class="param-type">null | string</span>
18+
<br>
19+
<p class="param-description">리포지토리의 작업 디렉터리 경로를 반환해요. <code>bare</code> 리포지토리인 경우 <code>null</code>을 반환해요.</p>
20+
</li>
21+
</ul>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
<ul class="param-ul">
16+
<li class="param-li param-li-root">
17+
<span class="param-type">Reference</span>
18+
<br>
19+
<p class="param-description">Reference pointed at by <code>HEAD</code> .</p>
20+
</li>
21+
</ul>

0 commit comments

Comments
 (0)