Skip to content

Commit 5131967

Browse files
committed
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
2 parents 2f8c654 + fd2e7da commit 5131967

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

worktree.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ static struct worktree *get_main_worktree(void)
8080
int is_bare = 0;
8181
int is_detached = 0;
8282

83-
strbuf_addstr(&worktree_path, absolute_path(get_git_common_dir()));
83+
strbuf_add_absolute_path(&worktree_path, get_git_common_dir());
8484
is_bare = !strbuf_strip_suffix(&worktree_path, "/.git");
8585
if (is_bare)
8686
strbuf_strip_suffix(&worktree_path, "/.");
@@ -125,7 +125,7 @@ static struct worktree *get_linked_worktree(const char *id)
125125
strbuf_rtrim(&worktree_path);
126126
if (!strbuf_strip_suffix(&worktree_path, "/.git")) {
127127
strbuf_reset(&worktree_path);
128-
strbuf_addstr(&worktree_path, absolute_path("."));
128+
strbuf_add_absolute_path(&worktree_path, ".");
129129
strbuf_strip_suffix(&worktree_path, "/.");
130130
}
131131

0 commit comments

Comments
 (0)