Commit 2fbdb5aefebc67efda0c651e17b9094d46633d1a

Stefan Sperling 2018-12-29T15:54:00

remove useless strdup from got_worktree_get_repo_path()

diff --git a/include/got_worktree.h b/include/got_worktree.h
index 80de9bd..7ffb70a 100644
--- a/include/got_worktree.h
+++ b/include/got_worktree.h
@@ -42,13 +42,11 @@ void got_worktree_close(struct got_worktree *);
 
 /*
  * Get the path to the repository associated with a worktree.
- * The caller must dispose of it with free(3).
  */
-char *got_worktree_get_repo_path(struct got_worktree *);
+const char *got_worktree_get_repo_path(struct got_worktree *);
 
 /*
  * Get the path prefix associated with a worktree.
- * The caller must dispose of it with free(3).
  */
 const char *got_worktree_get_path_prefix(struct got_worktree *);
 
diff --git a/lib/worktree.c b/lib/worktree.c
index c55f3e7..548c20a 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -370,10 +370,10 @@ got_worktree_close(struct got_worktree *worktree)
 	free(worktree);
 }
 
-char *
+const char *
 got_worktree_get_repo_path(struct got_worktree *worktree)
 {
-	return strdup(worktree->repo_path);
+	return worktree->repo_path;
 }
 
 const char *