Skip to content

Commit 7779932

Browse files
author
Carson Howard
committed
docs: update differences-from-git to be more concise
1 parent 0f69a32 commit 7779932

File tree

2 files changed

+20
-40
lines changed

2 files changed

+20
-40
lines changed

docs/differences-from-git-cli.md

Lines changed: 0 additions & 40 deletions
This file was deleted.

docs/differences-from-git.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Differences from Git
2+
3+
In some instances, the functionality of libgit2 deviates slightly from Git. This can be because of technical limitations when developing a library, licensing limitations when converting functionality from Git to libgit2, or various other reasons.
4+
5+
Repository and Workdir Path Reporting
6+
-------------------------------------
7+
8+
When asking Git for the absolute path of a repository via `git rev-parse --absolute-git-dir`, it will output the path to the ".git" folder without a trailing slash. In contrast to that, the call `git_repository_path(repo)` will return the path with a trailing slash:
9+
10+
```
11+
git rev-parse --absolute-git-dir -> /home/user/projects/libgit2/.git
12+
git_repository_path(repo) -> /home/user/projects/libgit2/.git/
13+
```
14+
15+
The same difference exists when listing worktrees:
16+
17+
```
18+
git worktree list -> /home/user/projects/libgit2
19+
git_repository_workdir(repo) -> /home/user/projects/libgit2/
20+
```

0 commit comments

Comments
 (0)