commit - c34b20a267f11d16c26b79b2979d91fc9a75132f
commit + e77c4c9f24dccb34ff8c4f500b0764011635cff2
blob - 8646f35a6980e076df57e4bae034c5be6d66628e
blob + 5694eaebb55252cb517324287f062e32a9a29b19
--- lib/got_worktree_lib.h
+++ lib/got_worktree_lib.h
#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"
blob - e7ba544ae402ec0cfcc1c84183ca0c8278771fd4
blob + 5543614b4e88cd79cc2f037d2bb4c4ce72148758
--- lib/worktree.c
+++ lib/worktree.c
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) {
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)
blob - ecc33b7be943945e294ef8d5d41fdc426d07ed4c
blob + 11419282913ae660313cf2d565598eb9c6a37c4c
--- regress/worktree/worktree_test.c
+++ regress/worktree/worktree_test.c
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))
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))
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,
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