File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -372,10 +372,10 @@ func (c *Server) addDirectory(d directory) error {
372
372
return nil
373
373
}
374
374
375
- type bareness int
375
+ type bareOpt int
376
376
377
377
const (
378
- bareAuto bareness = iota
378
+ bareAuto bareOpt = iota
379
379
bareOn
380
380
bareOff
381
381
)
@@ -385,7 +385,7 @@ type directory struct {
385
385
Format string
386
386
Bucket int
387
387
Rooted bool
388
- Bare bareness
388
+ Bare bareOpt
389
389
}
390
390
391
391
var (
@@ -431,18 +431,17 @@ func parseDirectory(dir directory) (directory, error) {
431
431
dir .Format = val
432
432
433
433
case "bare" :
434
- if val != "true" && val != "false" && val != "auto" {
435
- logrus .Errorf ("invalid value in bare, it can only " +
436
- "be true, false, or auto %v" , val )
437
- return dir , ErrInvalid
438
- }
439
434
switch val {
440
435
case "true" :
441
436
dir .Bare = bareOn
442
437
case "false" :
443
438
dir .Bare = bareOff
444
439
case "auto" :
445
440
dir .Bare = bareAuto
441
+ default :
442
+ logrus .Errorf ("invalid value in bare, it can only " +
443
+ "be true, false, or auto %v" , val )
444
+ return dir , ErrInvalid
446
445
}
447
446
448
447
case "rooted" :
Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ func TestDiscoverBare(t *testing.T) {
182
182
183
183
tests := []struct {
184
184
path string
185
- bare bareness
185
+ bare bareOpt
186
186
expected bool
187
187
err bool
188
188
}{
You can’t perform that action at this time.
0 commit comments