diff options
author | Patrick Steinhardt <ps@pks.im> | 2016-11-04 11:59:52 +0100 |
---|---|---|
committer | Patrick Steinhardt <ps@pks.im> | 2017-02-13 11:07:52 +0100 |
commit | 84f56cb05afe7a60501f310ba1329bb98ef8756d (patch) | |
tree | 69c54d4ce619b753d64ec09b4360cfcc4f21df1e /src/fetchhead.c | |
parent | 384518d09dc16b8a7dae22069e0c612e4b65c5e8 (diff) | |
download | libgit2-84f56cb05afe7a60501f310ba1329bb98ef8756d.tar.gz |
repository: rename `path_repository` and `path_gitlink`
The `path_repository` variable is actually confusing to think
about, as it is not always clear what the repository actually is.
It may either be the path to the folder containing worktree and
.git directory, the path to .git itself, a worktree or something
entirely different. Actually, the intent of the variable is to
hold the path to the gitdir, which is either the .git directory
or the bare repository.
Rename the variable to `gitdir` to avoid confusion. While at it,
also rename `path_gitlink` to `gitlink` to improve consistency.
Diffstat (limited to 'src/fetchhead.c')
-rw-r--r-- | src/fetchhead.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fetchhead.c b/src/fetchhead.c index 0d9ab2c25..6e6f3eb5e 100644 --- a/src/fetchhead.c +++ b/src/fetchhead.c @@ -115,7 +115,7 @@ int git_fetchhead_write(git_repository *repo, git_vector *fetchhead_refs) assert(repo && fetchhead_refs); - if (git_buf_joinpath(&path, repo->path_repository, GIT_FETCH_HEAD_FILE) < 0) + if (git_buf_joinpath(&path, repo->gitdir, GIT_FETCH_HEAD_FILE) < 0) return -1; if (git_filebuf_open(&file, path.ptr, GIT_FILEBUF_FORCE, GIT_REFS_FILE_MODE) < 0) { @@ -249,7 +249,7 @@ int git_repository_fetchhead_foreach(git_repository *repo, assert(repo && cb); - if (git_buf_joinpath(&path, repo->path_repository, GIT_FETCH_HEAD_FILE) < 0) + if (git_buf_joinpath(&path, repo->gitdir, GIT_FETCH_HEAD_FILE) < 0) return -1; if ((error = git_futils_readbuffer(&file, git_buf_cstr(&path))) < 0) |