commit 35be1456d63733ac069f13cc4b0b75b1f922ae70 from: Stefan Sperling date: Sun Mar 11 13:27:53 2018 UTC implement got_worktree_get_head_ref_name() commit - e559c32898498c8fd40f79311eb511d030fb44a6 commit + 35be1456d63733ac069f13cc4b0b75b1f922ae70 blob - e3dda9b4d776c6e9cacb6e6330cd0a3fb71bf1dd blob + 190780e7256bee86cf284ce25cb000200af2f4a2 --- include/got_worktree.h +++ include/got_worktree.h @@ -21,7 +21,7 @@ const struct got_error *got_worktree_init(const char * const struct got_error *got_worktree_open(struct got_worktree **, const char *); void got_worktree_close(struct got_worktree *); char *got_worktree_get_repo_path(struct got_worktree *); -struct got_reference *got_worktree_get_head(struct got_worktree *); +char *got_worktree_get_head_ref_name(struct got_worktree *); const struct got_error *got_worktree_change_head(struct got_worktree *, struct got_reference *, struct got_repository *); const struct got_error *got_worktree_checkout_files(struct got_worktree *, blob - a561e0be59a311f3ed05f30a54a081b3c5150a5a blob + 70a5f978233a588573801160b07e51f45571ea72 --- lib/worktree.c +++ lib/worktree.c @@ -334,10 +334,10 @@ got_worktree_get_repo_path(struct got_worktree *worktr return strdup(worktree->repo_path); } -struct got_reference * -got_worktree_get_head(struct got_worktree *worktree) +char * +got_worktree_get_head_ref_name(struct got_worktree *worktree) { - return NULL; + return strdup(worktree->head_ref); } const struct got_error *