worktree: use skip_prefix to parse target
commita46d1f732192a8621ead7ea5c4a3ca391ad881cb
authorMartin Ågren <martin.agren@gmail.com>
Sun, 27 Sep 2020 13:15:47 +0000 (27 15:15 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 27 Sep 2020 21:21:47 +0000 (27 14:21 -0700)
tree56d7c34b92ae98fc40c5fc76e4cea9a50dc410e9
parentfb07bd42975bcbfbc29d4a3ef1bff1039a469336
worktree: use skip_prefix to parse target

Instead of checking for "refs/heads/" using `starts_with()`, then
skipping past "refs/heads/" using `strlen()`, just use `skip_prefix()`.

In `is_worktree_being_rebased()`, we can adjust the indentation while
we're here and lose a pair of parentheses which isn't needed and which
might even make the reader wonder what they're missing and why that
grouping is there.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
worktree.c