commit - 0605801d8523648622fc2176fd0422d3d5a6ad57
commit + 65e3b818196debd0e5c6cc7c1f3182ee2d253fe2
blob - df56c0dec9b4f886d0894e14ad05aea9fde11040
blob + d207ee390d6e7f6252e01034122dc9e112bfd66d
--- lib/got_sha1_priv.h
+++ lib/got_sha1_priv.h
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#define GOT_SHA1_STRING_ZERO "0000000000000000000000000000000000000000"
+
int got_parse_sha1_digest(uint8_t *, const char *);
char *got_sha1_digest_to_str(const uint8_t *, char *, size_t);
blob - 206bddffe16837ad2826addc8148245913869383
blob + bc1edd34d187f7078fd4a00b974cab027515c3cd
--- lib/got_worktree_priv.h
+++ lib/got_worktree_priv.h
#define GOT_WORKTREE_FORMAT "format"
#define GOT_WORKTREE_FORMAT_VERSION 1
+#define GOT_WORKTREE_INVALID_COMMIT_ID GOT_SHA1_STRING_ZERO
blob - a84d489d174231aa2398640506134304ea5d1ba7
blob + eb722edb16fe07622e56476421c81acadc42234e
--- lib/worktree.c
+++ lib/worktree.c
#include "got_worktree_priv.h"
#include "got_path_priv.h"
+#include "got_sha1_priv.h"
static const struct got_error *
create_meta_file(const char *path_got, const char *name, const char *content)
if (err)
goto done;
- /* Set base commit to empty. */
- err = create_meta_file(path_got, GOT_WORKTREE_BASE_COMMIT, NULL);
+ /* 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;