mirror of
https://github.com/libgit2/libgit2.git
synced 2026-06-22 06:26:26 +00:00
docs: update differences-from-git to be more concise
This commit is contained in:
20
docs/differences-from-git.md
Normal file
20
docs/differences-from-git.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Differences from Git
|
||||
|
||||
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.
|
||||
|
||||
Repository and Workdir Path Reporting
|
||||
-------------------------------------
|
||||
|
||||
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:
|
||||
|
||||
```
|
||||
git rev-parse --absolute-git-dir -> /home/user/projects/libgit2/.git
|
||||
git_repository_path(repo) -> /home/user/projects/libgit2/.git/
|
||||
```
|
||||
|
||||
The same difference exists when listing worktrees:
|
||||
|
||||
```
|
||||
git worktree list -> /home/user/projects/libgit2
|
||||
git_repository_workdir(repo) -> /home/user/projects/libgit2/
|
||||
```
|
||||
Reference in New Issue
Block a user