diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-08-08 14:21:45 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-08-08 14:21:45 -0700 |
commit | 5131967e4add92322c495e93c0947bac00fbd623 (patch) | |
tree | 59b60d43bc600904a08cce26a6a9c0d333abeb8f | |
parent | 2f8c654edb0c8805749c60228ad9abb5984fba63 (diff) | |
parent | fd2e7dafdeef4e9ba3c023427deb4e21ba5b31a8 (diff) | |
download | git-5131967e4add92322c495e93c0947bac00fbd623.tar.gz |
Merge branch 'rs/worktree-use-strbuf-absolute-path' into maint
Code simplification.
* rs/worktree-use-strbuf-absolute-path:
worktree: use strbuf_add_absolute_path() directly
-rw-r--r-- | worktree.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/worktree.c b/worktree.c index 199b1ef94b..6b4f5f3e6d 100644 --- a/worktree.c +++ b/worktree.c @@ -80,7 +80,7 @@ static struct worktree *get_main_worktree(void) int is_bare = 0; int is_detached = 0; - strbuf_addstr(&worktree_path, absolute_path(get_git_common_dir())); + strbuf_add_absolute_path(&worktree_path, get_git_common_dir()); is_bare = !strbuf_strip_suffix(&worktree_path, "/.git"); if (is_bare) strbuf_strip_suffix(&worktree_path, "/."); @@ -125,7 +125,7 @@ static struct worktree *get_linked_worktree(const char *id) strbuf_rtrim(&worktree_path); if (!strbuf_strip_suffix(&worktree_path, "/.git")) { strbuf_reset(&worktree_path); - strbuf_addstr(&worktree_path, absolute_path(".")); + strbuf_add_absolute_path(&worktree_path, "."); strbuf_strip_suffix(&worktree_path, "/."); } |