]> git.proxmox.com Git - libgit2.git/blame - docs/differences-from-git.md
Upload to experimental
[libgit2.git] / docs / differences-from-git.md
CommitLineData
ac3d33df
JK
1# Differences from Git
2
3In 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
5Repository and Workdir Path Reporting
6-------------------------------------
7
8When 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```
11git rev-parse --absolute-git-dir -> /home/user/projects/libgit2/.git
12git_repository_path(repo) -> /home/user/projects/libgit2/.git/
13```
14
15The same difference exists when listing worktrees:
16
17```
18git worktree list -> /home/user/projects/libgit2
19git_repository_workdir(repo) -> /home/user/projects/libgit2/
20```
21
22Windows Junction Points
23-----------------------
24
25In libgit2, junction points are treated like symbolic links. They're handled specially in `git_win32__file_attribute_to_stat` in `src/win/w32_util.h`. This means that libgit2 tracks the directory itself as a link.
26
27In Git for Windows, junction points are treated like regular directories. This means that Git for Windows tracks the contents of the directory.