commit - 4acef5eedd5863726d7d94dde5b8e8beb13aeaf2
commit + 0f92850ea290f1ce78faa0f9ba874abec8477dea
blob - 75906a3d0c3bc85aceb9a38f7f965526ec15b9cc
blob + 6eb1b51ed3c706b530176f8baa1f130982d4e4ce
--- lib/got_lib_worktree.h
+++ lib/got_lib_worktree.h
};
#define GOT_WORKTREE_GOT_DIR ".got"
-#define GOT_WORKTREE_FILE_INDEX "fileindex"
+#define GOT_WORKTREE_FILE_INDEX "file-index"
#define GOT_WORKTREE_REPOSITORY "repository"
#define GOT_WORKTREE_PATH_PREFIX "path-prefix"
-#define GOT_WORKTREE_HEAD "head"
-#define GOT_WORKTREE_BASE "base"
+#define GOT_WORKTREE_HEAD_REF "head-ref"
+#define GOT_WORKTREE_BASE_COMMIT "base-commit"
#define GOT_WORKTREE_LOCK "lock"
#define GOT_WORKTREE_FORMAT "format"
blob - 673aed2f7eff4a8513878d5be8013592ce0d75a1
blob + 091974e1f03ab5beccb3a5411a64b8b933ba03be
--- lib/worktree.c
+++ lib/worktree.c
err = got_error_from_errno();
goto done;
}
- err = create_meta_file(path_got, GOT_WORKTREE_HEAD, refstr);
+ err = create_meta_file(path_got, GOT_WORKTREE_HEAD_REF, refstr);
if (err)
goto done;
err = got_object_id_str(&basestr, commit_id);
if (err)
goto done;
- err = create_meta_file(path_got, GOT_WORKTREE_BASE, basestr);
+ err = create_meta_file(path_got, GOT_WORKTREE_BASE_COMMIT, basestr);
if (err)
goto done;
if (err)
goto done;
- err = read_meta_file(&(*worktree)->base, path_got, GOT_WORKTREE_BASE);
+ err = read_meta_file(&(*worktree)->base, path_got,
+ GOT_WORKTREE_BASE_COMMIT);
if (err)
goto done;
err = read_meta_file(&(*worktree)->head_ref, path_got,
- GOT_WORKTREE_HEAD);
+ GOT_WORKTREE_HEAD_REF);
if (err)
goto done;
blob - 476ab3d1513ea3b719e817918075368ae0df1b1a
blob + 97409738a5031f53ff0820057c3f280dde8010e6
--- regress/worktree/worktree_test.c
+++ regress/worktree/worktree_test.c
static int
remove_worktree(const char *worktree_path)
{
- if (!remove_meta_file(worktree_path, GOT_WORKTREE_HEAD))
+ if (!remove_meta_file(worktree_path, GOT_WORKTREE_HEAD_REF))
return 0;
- if (!remove_meta_file(worktree_path, GOT_WORKTREE_BASE))
+ if (!remove_meta_file(worktree_path, GOT_WORKTREE_BASE_COMMIT))
return 0;
if (!remove_meta_file(worktree_path, GOT_WORKTREE_FILE_INDEX))
return 0;
goto done;
/* Ensure required files were created. */
- if (!check_meta_file_exists(worktree_path, GOT_WORKTREE_HEAD))
+ if (!check_meta_file_exists(worktree_path, GOT_WORKTREE_HEAD_REF))
goto done;
- if (!check_meta_file_exists(worktree_path, GOT_WORKTREE_BASE))
+ if (!check_meta_file_exists(worktree_path, GOT_WORKTREE_BASE_COMMIT))
goto done;
if (!check_meta_file_exists(worktree_path, GOT_WORKTREE_LOCK))
goto done;
/* Create files which got_worktree_init() will try to create as well. */
if (!obstruct_meta_file_and_init(&ok, repo, worktree_path,
- GOT_WORKTREE_HEAD))
+ GOT_WORKTREE_HEAD_REF))
goto done;
if (!obstruct_meta_file_and_init(&ok, repo, worktree_path,
- GOT_WORKTREE_BASE))
+ GOT_WORKTREE_BASE_COMMIT))
goto done;
if (!obstruct_meta_file_and_init(&ok, repo, worktree_path,
GOT_WORKTREE_LOCK))