commit e77c4c9f24dccb34ff8c4f500b0764011635cff2 from: Stefan Sperling date: Mon Mar 12 12:37:17 2018 UTC remove base-commit meta file; this will move into the fileindex commit - c34b20a267f11d16c26b79b2979d91fc9a75132f commit + e77c4c9f24dccb34ff8c4f500b0764011635cff2 blob - 8646f35a6980e076df57e4bae034c5be6d66628e blob + 5694eaebb55252cb517324287f062e32a9a29b19 --- lib/got_worktree_lib.h +++ 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" blob - e7ba544ae402ec0cfcc1c84183ca0c8278771fd4 blob + 5543614b4e88cd79cc2f037d2bb4c4ce72148758 --- lib/worktree.c +++ lib/worktree.c @@ -188,12 +188,6 @@ got_worktree_init(const char *path, struct got_referen 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, cons 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 @@ -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