summaryrefslogtreecommitdiff
path: root/worktree.c
diff options
context:
space:
mode:
Diffstat (limited to 'worktree.c')
-rw-r--r--worktree.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/worktree.c b/worktree.c
index 6a236d2..0b12525 100644
--- a/worktree.c
+++ b/worktree.c
@@ -352,11 +352,11 @@ int is_worktree_being_rebased(const struct worktree *wt,
memset(&state, 0, sizeof(state));
found_rebase = wt_status_check_rebase(wt, &state) &&
- ((state.rebase_in_progress ||
- state.rebase_interactive_in_progress) &&
- state.branch &&
- starts_with(target, "refs/heads/") &&
- !strcmp(state.branch, target + strlen("refs/heads/")));
+ (state.rebase_in_progress ||
+ state.rebase_interactive_in_progress) &&
+ state.branch &&
+ skip_prefix(target, "refs/heads/", &target) &&
+ !strcmp(state.branch, target);
wt_status_state_free_buffers(&state);
return found_rebase;
}
@@ -370,8 +370,8 @@ int is_worktree_being_bisected(const struct worktree *wt,
memset(&state, 0, sizeof(state));
found_bisect = wt_status_check_bisect(wt, &state) &&
state.branch &&
- starts_with(target, "refs/heads/") &&
- !strcmp(state.branch, target + strlen("refs/heads/"));
+ skip_prefix(target, "refs/heads/", &target) &&
+ !strcmp(state.branch, target);
wt_status_state_free_buffers(&state);
return found_bisect;
}