Skip to content

Commit dbfb250

Browse files
author
Timothy Harding
committed
Add test cases
1 parent de80cff commit dbfb250

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

tests/_tide_item_git.test.fish

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff 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 --------
74104
cd $dir/bare-repo
75105
_git init --bare

0 commit comments

Comments
 (0)