summaryrefslogtreecommitdiff
path: root/builtin/fetch.c
diff options
context:
space:
mode:
authorDerrick Stolee <derrickstolee@github.com>2022-06-14 19:27:30 +0000
committerJunio C Hamano <gitster@pobox.com>2022-06-15 10:47:18 -0700
commitd2ba271aad0e7f90b475be6225c59cb4f1bfbe4f (patch)
tree5ffcd49e19a9921317f44ca04a591324a3ba71be /builtin/fetch.c
parent31ad6b61bdaa408f2616d7dca0f6d66ee4742c8d (diff)
branch: check for bisects and rebases
The branch_checked_out() helper was added by the previous change, but it used an over-simplified view to check if a branch is checked out. It only focused on the HEAD symref, but ignored whether a bisect or rebase was happening. Teach branch_checked_out() to check for these things, and also add tests to ensure that we do not lose this functionality in the future. Now that this test coverage exists, we can safely refactor validate_new_branchname() to use branch_checked_out(). Note that we need to prepend "refs/heads/" to the 'state.branch' after calling wt_status_check_*(). We also need to duplicate wt->path so the value is not freed at the end of the call. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fetch.c')
0 files changed, 0 insertions, 0 deletions