worktree.c: rewrite mark_current_worktree() to avoid strbuf
commit360af2dadaae70f29de2f21d4eb8ac38aefcc263
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sun, 22 May 2016 09:33:52 +0000 (22 16:33 +0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 24 May 2016 20:19:22 +0000 (24 13:19 -0700)
treef1be3a21d431e8e6321c00809d90a51169fdd222
parentb462c024022e3a41821f24bca9e43f16973693db
worktree.c: rewrite mark_current_worktree() to avoid strbuf

strbuf is a bit overkill for this function. What we need is to call
absolute_path() twice and make sure the second call does not destroy the
result of the first. One buffer allocation is enough.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
worktree.c