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 {
134134 return "???"
135135 }
136136 case "commit" , "tag" :
137- if p .parent != nil {
137+ switch {
138+ case p .parent != nil :
138139 // The parent is a tag.
139140 return fmt .Sprintf ("%s^{%s}" , p .parent .BestPath (), p .objectType )
140- } else if p .relativePath != "" {
141+ case p .relativePath != "" :
141142 return p .relativePath + ":"
142- } else {
143+ default :
143144 return p .OID .String () + ":"
144145 }
145146 default :
@@ -164,12 +165,13 @@ func (p *Path) Path() string {
164165 return ""
165166 }
166167 case "commit" , "tag" :
167- if p .parent != nil {
168+ switch {
169+ case p .parent != nil :
168170 // The parent is a tag.
169171 return fmt .Sprintf ("%s^{%s}" , p .parent .BestPath (), p .objectType )
170- } else if p .relativePath != "" {
172+ case p .relativePath != "" :
171173 return p .relativePath
172- } else {
174+ default :
173175 return ""
174176 }
175177 default :
You can’t perform that action at this time.
0 commit comments