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/cherrypick.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/cherrypick.c')
| -rw-r--r-- | src/cherrypick.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cherrypick.c b/src/cherrypick.c index ab067339e..d8b6858ae 100644 --- a/src/cherrypick.c +++ b/src/cherrypick.c @@ -28,7 +28,7 @@ static int write_cherrypick_head( git_buf file_path = GIT_BUF_INIT; int error = 0; - if ((error = git_buf_joinpath(&file_path, repo->path_repository, GIT_CHERRYPICK_HEAD_FILE)) >= 0 && + if ((error = git_buf_joinpath(&file_path, repo->gitdir, GIT_CHERRYPICK_HEAD_FILE)) >= 0 && (error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_FORCE, GIT_CHERRYPICK_FILE_MODE)) >= 0 && (error = git_filebuf_printf(&file, "%s\n", commit_oidstr)) >= 0) error = git_filebuf_commit(&file); @@ -49,7 +49,7 @@ static int write_merge_msg( git_buf file_path = GIT_BUF_INIT; int error = 0; - if ((error = git_buf_joinpath(&file_path, repo->path_repository, GIT_MERGE_MSG_FILE)) < 0 || + if ((error = git_buf_joinpath(&file_path, repo->gitdir, GIT_MERGE_MSG_FILE)) < 0 || (error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_FORCE, GIT_CHERRYPICK_FILE_MODE)) < 0 || (error = git_filebuf_printf(&file, "%s", commit_msg)) < 0) goto cleanup; |
