File tree 1 file changed +16
-6
lines changed
1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change 1
1
package main
2
2
3
3
import (
4
+ "errors"
4
5
"net"
5
6
"os"
6
7
"strconv"
@@ -41,17 +42,26 @@ func (c *cmdServer) buildDatabase() error {
41
42
c .engine = sqle .New ()
42
43
}
43
44
44
- if c .Git ! = "" {
45
- logrus . WithField ( "dir" , c . Git ). Debug ( "added folder containing git repositories " )
45
+ if c .Git == "" && c . Siva = = "" {
46
+ return errors . New ( "missing git or siva directories " )
46
47
}
47
48
48
49
c .pool = gitbase .NewRepositoryPool ()
49
- if err := c .pool .AddDir (c .Git ); err != nil {
50
- return err
50
+
51
+ if c .Git != "" {
52
+ logrus .WithField ("dir" , c .Git ).Debug ("added folder containing git repositories" )
53
+
54
+ if err := c .pool .AddDir (c .Git ); err != nil {
55
+ return err
56
+ }
51
57
}
52
58
53
- if err := c .pool .AddSivaDir (c .Siva ); err != nil {
54
- return err
59
+ if c .Siva != "" {
60
+ logrus .WithField ("dir" , c .Siva ).Debug ("added folder containing siva repositories" )
61
+
62
+ if err := c .pool .AddSivaDir (c .Siva ); err != nil {
63
+ return err
64
+ }
55
65
}
56
66
57
67
c .engine .AddDatabase (gitbase .NewDatabase (c .name ))
You can’t perform that action at this time.
0 commit comments