Я считаю, что это связано с тем, как оператор break
переводится в машинный код. Оператор break
будет переведен как безусловная ветвь на метку сразу после цикла или переключателя.
mov ECX,5
label1:
jmp <to next instruction address> ;break
loop label1
<next instruction>
Хотя вызов foo()
изнутри цикла приведет к чему-то вроде
mov ECX,5
label1:
call <foo address>
loop label1
<next instruction>
и по адресу foo
call <printf address>
jmp <to where?> ;break cannot translate to any address.
Just do git checkout -b new_branch
. It will create the new branch with the changes in your working tree untouched.
If in the future you need to see whether Git would destroy something you haven’t committed yet (which it generally will never do), use git stash
to stow away your changes. It will not save files that Git does not know about but Git will also refuse to overwrite unknown files in case of checkouts and similar operations.