File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,6 +70,36 @@ _git_item # CHECK: …anch_name
7070_git checkout -b 10charhere
7171_git_item # CHECK: 10charhere
7272
73+ # --- Hide branch ---
74+ _git checkout main
75+ echo > bar
76+ set -lx tide_git_hide_branch true
77+ _git_item # CHECK-NOT: main
78+ _git_item # CHECK: ?1
79+
80+ # Staged files still show with hidden branch
81+ _git add bar
82+ _git_item # CHECK: +1
83+
84+ # Mixed signs with hidden branch (verify spacing)
85+ echo modified > foo
86+ _git_item # CHECK: +1 !1
87+
88+ # Verify tags still show when branch hiding enabled
89+ _git commit -m ' Add bar'
90+ _git tag v1.0
91+ _git checkout v1.0
92+ _git_item # CHECK: #v1.0
93+
94+ # Verify SHA still shows in detached HEAD
95+ _git checkout HEAD~
96+ _git_item # CHECK: {{@\w*}}
97+
98+ # Toggle back to showing branch
99+ _git checkout main
100+ set -lx tide_git_hide_branch false
101+ _git_item # CHECK: main
102+
73103# -------- bare repo test --------
74104cd $dir /bare-repo
75105_git init --bare
You can’t perform that action at this time.
0 commit comments