remove base-commit meta file; this will move into the fileindex
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
diff --git a/lib/got_worktree_lib.h b/lib/got_worktree_lib.h
index 8646f35..5694eae 100644
--- a/lib/got_worktree_lib.h
+++ b/lib/got_worktree_lib.h
@@ -38,7 +38,6 @@ struct got_worktree {
#define GOT_WORKTREE_FILE_INDEX "fileindex"
#define GOT_WORKTREE_REPOSITORY "repository"
#define GOT_WORKTREE_PATH_PREFIX "path-prefix"
-#define GOT_WORKTREE_BASE_COMMIT "base-commit"
#define GOT_WORKTREE_HEAD "head"
#define GOT_WORKTREE_LOCK "lock"
#define GOT_WORKTREE_FORMAT "format"
diff --git a/lib/worktree.c b/lib/worktree.c
index e7ba544..5543614 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -188,12 +188,6 @@ got_worktree_init(const char *path, struct got_reference *head_ref,
if (err)
goto done;
- /* Save an invalid base commit hash. */
- err = create_meta_file(path_got, GOT_WORKTREE_BASE_COMMIT,
- GOT_WORKTREE_INVALID_COMMIT_ID);
- if (err)
- goto done;
-
/* Write the HEAD reference. */
refstr = got_ref_to_str(head_ref);
if (refstr == NULL) {
@@ -303,11 +297,6 @@ got_worktree_open(struct got_worktree **worktree, const char *path)
if (err)
goto done;
- err = read_meta_file(&(*worktree)->base_commit, path_got,
- GOT_WORKTREE_BASE_COMMIT);
- if (err)
- goto done;
-
err = read_meta_file(&(*worktree)->head_ref, path_got,
GOT_WORKTREE_HEAD);
if (err)
diff --git a/regress/worktree/worktree_test.c b/regress/worktree/worktree_test.c
index ecc33b7..1141928 100644
--- a/regress/worktree/worktree_test.c
+++ b/regress/worktree/worktree_test.c
@@ -89,8 +89,6 @@ remove_worktree(const char *worktree_path)
return 0;
if (!remove_meta_file(worktree_path, GOT_WORKTREE_PATH_PREFIX))
return 0;
- if (!remove_meta_file(worktree_path, GOT_WORKTREE_BASE_COMMIT))
- return 0;
if (!remove_meta_file(worktree_path, GOT_WORKTREE_LOCK))
return 0;
if (!remove_meta_file(worktree_path, GOT_WORKTREE_FORMAT))
@@ -174,8 +172,6 @@ worktree_init(const char *repo_path)
goto done;
if (!check_meta_file_exists(worktree_path, GOT_WORKTREE_LOCK))
goto done;
- if (!check_meta_file_exists(worktree_path, GOT_WORKTREE_BASE_COMMIT))
- goto done;
if (!check_meta_file_exists(worktree_path, GOT_WORKTREE_FILE_INDEX))
goto done;
if (!check_meta_file_exists(worktree_path, GOT_WORKTREE_REPOSITORY))
@@ -280,9 +276,6 @@ worktree_init_exists(const char *repo_path)
GOT_WORKTREE_LOCK))
goto done;
if (!obstruct_meta_file_and_init(&ok, repo, worktree_path,
- GOT_WORKTREE_BASE_COMMIT))
- goto done;
- if (!obstruct_meta_file_and_init(&ok, repo, worktree_path,
GOT_WORKTREE_FILE_INDEX))
goto done;
if (!obstruct_meta_file_and_init(&ok, repo, worktree_path,
@@ -299,9 +292,9 @@ done:
if (repo)
got_repo_close(repo);
free(gotpath);
- if (ok == 7)
+ if (ok == 6)
remove_worktree(worktree_path);
- return (ok == 7);
+ return (ok == 6);
}
static int