aboutsummaryrefslogtreecommitdiffstats
path: root/exec-cmd.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-11-23 14:11:41 +0900
committerJunio C Hamano <gitster@pobox.com>2023-11-23 15:01:09 +0900
commit9263c40a0a0c299db59b8a64e87b95026a28812a (patch)
tree2008dadc40e03300ed8e7985c3ffda5f9104d661 /exec-cmd.c
parentGit 2.43 (diff)
downloadgit-9263c40a0a0c299db59b8a64e87b95026a28812a.tar.gz
git-9263c40a0a0c299db59b8a64e87b95026a28812a.zip
checkout: refactor die_if_checked_out() caller
There is a bit dense logic to make a call to "die_if_checked_out()" while trying to check out a branch. Extract it into a helper function and give it a bit of comment to describe what is going on. The most important part of the refactoring is the separation of the guarding logic before making the call to die_if_checked_out() into the caller specific part (e.g., the logic that decides that the caller is trying to check out an existing branch) and the bypass due to the "--ignore-other-worktrees" option. The latter will be common no matter how the current or future callers decides they need this protection. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'exec-cmd.c')
0 files changed, 0 insertions, 0 deletions