summaryrefslogtreecommitdiffstats
path: root/docs/differences-from-git.md
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:47:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:47:08 +0000
commit29b5ab554790bb57337a3b6ab9dcd963cf69d22e (patch)
treebe1456d2bc6c1fb078695fad7bc8f6b212062d3c /docs/differences-from-git.md
parentInitial commit. (diff)
downloadlibgit2-29b5ab554790bb57337a3b6ab9dcd963cf69d22e.tar.xz
libgit2-29b5ab554790bb57337a3b6ab9dcd963cf69d22e.zip
Adding upstream version 1.7.2+ds.upstream/1.7.2+ds
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'docs/differences-from-git.md')
-rw-r--r--docs/differences-from-git.md27
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/differences-from-git.md b/docs/differences-from-git.md
new file mode 100644
index 0000000..3f46508
--- /dev/null
+++ b/docs/differences-from-git.md
@@ -0,0 +1,27 @@
+# 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/
+```
+
+Windows Junction Points
+-----------------------
+
+In 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.
+
+In Git for Windows, junction points are treated like regular directories. This means that Git for Windows tracks the contents of the directory.