commit 1ab61ced3b985960fcf0256e1720fb712311aeb7 from: Stefan Sperling date: Wed Jul 10 14:33:43 2019 UTC use absolute path for reference in got/worktree namespace commit - 950a4a905c4d772a32d335f2d3334e02c1dc7a40 commit + 1ab61ced3b985960fcf0256e1720fb712311aeb7 blob - 84f3dc1b2b51f685a865ccf9a0d194d305a82fd6 blob + 9809abfda0e41da7cba9bee90a6e329ed1c7f01f --- lib/got_lib_worktree.h +++ lib/got_lib_worktree.h @@ -61,7 +61,7 @@ struct got_commitable { #define GOT_WORKTREE_FORMAT_VERSION 1 #define GOT_WORKTREE_INVALID_COMMIT_ID GOT_SHA1_STRING_ZERO -#define GOT_WORKTREE_BASE_REF_PREFIX "got/worktree/base" +#define GOT_WORKTREE_BASE_REF_PREFIX "refs/got/worktree/base" const struct got_error *got_worktree_get_base_ref_name(char **, struct got_worktree *worktree); blob - 6cfa9eaa9e5fdee1f354906a1eed74177f0f7f6d blob + a64a34999861277292e9a747c737efb3002af876 --- regress/worktree/worktree_test.c +++ regress/worktree/worktree_test.c @@ -89,17 +89,13 @@ remove_worktree_base_ref(struct got_worktree *worktree { const struct got_error *err = NULL; struct got_reference *base_ref = NULL; - char *refname = NULL, *absrefname = NULL; + char *refname = NULL; err = got_worktree_get_base_ref_name(&refname, worktree); if (err) return err; - if (asprintf(&absrefname, "refs/%s", refname) == -1) { - err = got_error_from_errno("asprintf"); - goto done; - } - err = got_ref_open(&base_ref, repo, absrefname, 0); + err = got_ref_open(&base_ref, repo, refname, 0); if (err) goto done; @@ -108,7 +104,6 @@ done: if (base_ref) got_ref_close(base_ref); free(refname); - free(absrefname); return err; }