commit - e8f369580ec5089cc0699635df9c4ff1bccc26db
commit + cde76477d633de6791ecd9eb2be7ef127daa8f4f
blob - f691b7afd2ce973e707f0cfdb50e825617b8c488
blob + e569004fb798a0080e811e4b75bce6f4df3e179b
--- lib/got_worktree_priv.h
+++ lib/got_worktree_priv.h
*/
struct got_worktree {
- char *path_worktree_root;
- char *path_repo;
+ char *worktree_root;
+ char *repo_path;
char *path_prefix;
char *base_commit;
char *head_ref;
blob - 129390074ae0a5605d0629876e1b4b24c9ff125a
blob + 7b501c8c62693a4627a66d8b1e8946ead2b523bb
--- lib/worktree.c
+++ lib/worktree.c
const struct got_error *err = NULL;
char *path_got = NULL;
char *refstr = NULL;
- char *path_repos = NULL;
+ char *repo_path = NULL;
char *formatstr = NULL;
if (!got_path_is_absolute(prefix))
goto done;
/* Store path to repository. */
- path_repos = got_repo_get_path(repo);
- if (path_repos == NULL) {
+ repo_path = got_repo_get_path(repo);
+ if (repo_path == NULL) {
err = got_error(GOT_ERR_NO_MEM);
goto done;
}
- err = create_meta_file(path_got, GOT_WORKTREE_REPOSITORY, path_repos);
+ err = create_meta_file(path_got, GOT_WORKTREE_REPOSITORY, repo_path);
if (err)
goto done;
free(path_got);
free(formatstr);
free(refstr);
- free(path_repos);
+ free(repo_path);
return err;
}
const struct got_error *err = NULL;
char *path_got;
char *refstr = NULL;
- char *path_repos = NULL;
char *formatstr = NULL;
char *path_lock = NULL;
int version, fd = -1;
}
(*worktree)->lockfd = -1;
- (*worktree)->path_worktree_root = strdup(path);
- if ((*worktree)->path_worktree_root == NULL) {
+ (*worktree)->worktree_root = strdup(path);
+ if ((*worktree)->worktree_root == NULL) {
err = got_error(GOT_ERR_NO_MEM);
goto done;
}
- err = read_meta_file(&(*worktree)->path_repo, path_got,
+ err = read_meta_file(&(*worktree)->repo_path, path_got,
GOT_WORKTREE_REPOSITORY);
if (err)
goto done;
void
got_worktree_close(struct got_worktree *worktree)
{
- free(worktree->path_worktree_root);
- free(worktree->path_repo);
+ free(worktree->worktree_root);
+ free(worktree->repo_path);
free(worktree->path_prefix);
free(worktree->base_commit);
free(worktree->head_ref);
char *
got_worktree_get_repo_path(struct got_worktree *worktree)
{
- return strdup(worktree->path_repo);
+ return strdup(worktree->repo_path);
}
struct got_reference *