summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2012-02-03 12:45:43 +0100
committernulltoken <emeric.fermas@gmail.com>2012-02-03 12:46:50 +0100
commit99abb79d53781dda9bbdc7b896eaa383d8789cb3 (patch)
treef9ba87532e6c97eb21b5bf264d2e222238a69d9c /src
parent0a4aebb097bbe7a940c0f73174b756027105d92f (diff)
downloadlibgit2-99abb79d53781dda9bbdc7b896eaa383d8789cb3.tar.gz
repository: ensure that the path to the .git directory ends with a forward slash when opening a repository through a working directory path
This fixes an issue which was detected while using one of the libgit2 bindings [0]. The lack of the trailing forward slash led the name of references returned by git_reference_listall() to be prefixed with a forward slash. [0]: https://github.com/libgit2/libgit2sharp/pull/108
Diffstat (limited to 'src')
-rw-r--r--src/repository.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/repository.c b/src/repository.c
index 74f0d8f98..536522a9b 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -166,7 +166,7 @@ int git_repository_open(git_repository **repo_out, const char *path)
* of the working dir, by testing if it contains a `.git`
* folder inside of it.
*/
- git_path_contains_dir(&path_buf, DOT_GIT, 1); /* append on success */
+ git_path_contains_dir(&path_buf, GIT_DIR, 1); /* append on success */
/* ignore error, since it just means `path/.git` doesn't exist */
if (quickcheck_repository_dir(&path_buf) < GIT_SUCCESS) {