File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -134,12 +134,13 @@ func (p *Path) TreePrefix() string {
134
134
return "???"
135
135
}
136
136
case "commit" , "tag" :
137
- if p .parent != nil {
137
+ switch {
138
+ case p .parent != nil :
138
139
// The parent is a tag.
139
140
return fmt .Sprintf ("%s^{%s}" , p .parent .BestPath (), p .objectType )
140
- } else if p .relativePath != "" {
141
+ case p .relativePath != "" :
141
142
return p .relativePath + ":"
142
- } else {
143
+ default :
143
144
return p .OID .String () + ":"
144
145
}
145
146
default :
@@ -164,12 +165,13 @@ func (p *Path) Path() string {
164
165
return ""
165
166
}
166
167
case "commit" , "tag" :
167
- if p .parent != nil {
168
+ switch {
169
+ case p .parent != nil :
168
170
// The parent is a tag.
169
171
return fmt .Sprintf ("%s^{%s}" , p .parent .BestPath (), p .objectType )
170
- } else if p .relativePath != "" {
172
+ case p .relativePath != "" :
171
173
return p .relativePath
172
- } else {
174
+ default :
173
175
return ""
174
176
}
175
177
default :
You can’t perform that action at this time.
0 commit comments