File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,7 @@ type TypeConfig = {
15
15
} ;
16
16
17
17
export default ( config : TypeConfig = { } ) : Object => {
18
-
19
- config . gitPath = config . gitPath || __dirname ;
20
- let gitPath : string ;
18
+ let gitPath : string | null = null ;
21
19
22
20
const gitinfo = { } ;
23
21
@@ -127,14 +125,16 @@ export default (config: TypeConfig = {}): Object => {
127
125
return parseINI ( gitPath + '/config' ) ;
128
126
} ;
129
127
128
+ config . gitPath = config . gitPath || __dirname ;
129
+
130
130
if ( isGitDirectory ( config . gitPath ) ) {
131
131
gitPath = config . gitPath ;
132
132
} else {
133
133
gitPath = gitPath ( config . gitPath ) ;
134
134
}
135
135
136
136
/* istanbul ignore next */
137
- if ( ! gitPath ) {
137
+ if ( gitPath === null ) {
138
138
throw new Error ( 'config.gitPath is not a descendant of .git/ director.' ) ;
139
139
}
140
140
You can’t perform that action at this time.
0 commit comments