commit f5baf295a400cb72814473d46c190451e43f5672 from: Stefan Sperling date: Sun Mar 11 12:06:45 2018 UTC read base commit hash when worktree is opened commit - 65e3b818196debd0e5c6cc7c1f3182ee2d253fe2 commit + f5baf295a400cb72814473d46c190451e43f5672 blob - bc1edd34d187f7078fd4a00b974cab027515c3cd blob + cef7d3dd4332ca2ce211998bce72293d400903dc --- lib/got_worktree_priv.h +++ lib/got_worktree_priv.h @@ -18,6 +18,7 @@ struct got_worktree { char *path_worktree_root; char *path_repo; char *path_prefix; + char *base_commit; /* * File descriptor for the lock file, open while a work tree is open. blob - eb722edb16fe07622e56476421c81acadc42234e blob + b9b67fb7fce5703996b4ebb8f57584549c6604df --- lib/worktree.c +++ lib/worktree.c @@ -288,6 +288,12 @@ got_worktree_open(struct got_worktree **worktree, cons goto done; err = read_meta_file(&(*worktree)->path_prefix, path_got, GOT_WORKTREE_PATH_PREFIX); + if (err) + goto done; + + err = read_meta_file(&(*worktree)->base_commit, path_got, + GOT_WORKTREE_BASE_COMMIT); + if (err) goto done; done: