diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-07-25 14:13:37 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-07-25 14:13:37 -0700 |
commit | fc08d2d4add543b88d7e1573cb4be01adedfed00 (patch) | |
tree | ef31087d2a85623a61b0c789024241ceff1c707c /worktree.c | |
parent | 03f25e85d902e24250129fe0247407690c8d66ba (diff) | |
parent | fd2e7dafdeef4e9ba3c023427deb4e21ba5b31a8 (diff) | |
download | git-fc08d2d4add543b88d7e1573cb4be01adedfed00.tar.gz |
Merge branch 'rs/worktree-use-strbuf-absolute-path'
Code simplification.
* rs/worktree-use-strbuf-absolute-path:
worktree: use strbuf_add_absolute_path() directly
Diffstat (limited to 'worktree.c')
-rw-r--r-- | worktree.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/worktree.c b/worktree.c index e2a94e0476..b819baf0cd 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, "/."); } |