rename some fields in struct worktree
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
diff --git a/lib/got_worktree_priv.h b/lib/got_worktree_priv.h
index f691b7a..e569004 100644
--- a/lib/got_worktree_priv.h
+++ b/lib/got_worktree_priv.h
@@ -15,8 +15,8 @@
*/
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;
diff --git a/lib/worktree.c b/lib/worktree.c
index 1293900..7b501c8 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -143,7 +143,7 @@ got_worktree_init(const char *path, struct got_reference *head_ref,
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))
@@ -192,12 +192,12 @@ got_worktree_init(const char *path, struct got_reference *head_ref,
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;
@@ -219,7 +219,7 @@ done:
free(path_got);
free(formatstr);
free(refstr);
- free(path_repos);
+ free(repo_path);
return err;
}
@@ -229,7 +229,6 @@ got_worktree_open(struct got_worktree **worktree, const char *path)
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;
@@ -277,12 +276,12 @@ got_worktree_open(struct got_worktree **worktree, const char *path)
}
(*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;
@@ -319,8 +318,8 @@ 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);
@@ -332,7 +331,7 @@ got_worktree_close(struct got_worktree *worktree)
char *
got_worktree_get_repo_path(struct got_worktree *worktree)
{
- return strdup(worktree->path_repo);
+ return strdup(worktree->repo_path);
}
struct got_reference *