summaryrefslogtreecommitdiff
path: root/docs/differences-from-git.md
diff options
context:
space:
mode:
authorCarson Howard <carsonh@axosoft.com>2018-05-02 07:46:53 -0700
committerCarson Howard <carsonh@axosoft.com>2018-05-02 07:46:53 -0700
commit77799325f4cabb452c3f06c26121b9f596f13a70 (patch)
treef0fcc3e7ad2991fee8d44d7e0fa7aa3d929d11d9 /docs/differences-from-git.md
parent0f69a3242c651f5bf6a40e76c914c8f54bbd2407 (diff)
downloadlibgit2-77799325f4cabb452c3f06c26121b9f596f13a70.tar.gz
docs: update differences-from-git to be more concise
Diffstat (limited to 'docs/differences-from-git.md')
-rw-r--r--docs/differences-from-git.md20
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/differences-from-git.md b/docs/differences-from-git.md
new file mode 100644
index 000000000..feec5c115
--- /dev/null
+++ b/docs/differences-from-git.md
@@ -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/
+```