Commit e342c63
switch: reject "do nothing" case
"git checkout" can be executed without any arguments. What it does is
not exactly great: it switches from HEAD to HEAD and shows worktree
modification as a side effect.
Make switch reject this case. Just use "git status" if you want
that side effect. For switch, you have to either
- really switch a branch
- (explicitly) detach from the current branch
- create a new branch
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 5c06e26 commit e342c63
1 file changed
+9
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
1338 | 1339 | | |
1339 | 1340 | | |
1340 | 1341 | | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
1341 | 1348 | | |
1342 | 1349 | | |
1343 | 1350 | | |
| |||
1593 | 1600 | | |
1594 | 1601 | | |
1595 | 1602 | | |
| 1603 | + | |
1596 | 1604 | | |
1597 | 1605 | | |
1598 | 1606 | | |
| |||
1624 | 1632 | | |
1625 | 1633 | | |
1626 | 1634 | | |
| 1635 | + | |
1627 | 1636 | | |
1628 | 1637 | | |
1629 | 1638 | | |
| |||
0 commit comments