@@ -52,10 +52,13 @@ fse.remove(path.resolve(__dirname, repoDir))
52
52
return repository . refreshIndex ( ) ;
53
53
} )
54
54
. then ( function ( index ) {
55
- index . addByPath ( fileName ) ;
56
- index . write ( ) ;
57
-
58
- return index . writeTree ( ) ;
55
+ return index . addByPath ( fileName )
56
+ . then ( function ( ) {
57
+ return index . write ( ) ;
58
+ } )
59
+ . then ( function ( ) {
60
+ return index . writeTree ( ) ;
61
+ } ) ;
59
62
} )
60
63
. then ( function ( oid ) {
61
64
return repository . createCommit ( "HEAD" , baseSignature ,
@@ -95,10 +98,13 @@ fse.remove(path.resolve(__dirname, repoDir))
95
98
. then ( function ( ) {
96
99
return repository . refreshIndex ( )
97
100
. then ( function ( index ) {
98
- index . addByPath ( fileName ) ;
99
- index . write ( ) ;
100
-
101
- return index . writeTree ( ) ;
101
+ return index . addByPath ( fileName )
102
+ . then ( function ( ) {
103
+ return index . write ( ) ;
104
+ } )
105
+ . then ( function ( ) {
106
+ return index . writeTree ( ) ;
107
+ } ) ;
102
108
} ) ;
103
109
} )
104
110
. then ( function ( oid ) {
@@ -120,11 +126,15 @@ fse.remove(path.resolve(__dirname, repoDir))
120
126
) ;
121
127
} )
122
128
. then ( function ( ) {
123
- return repository . refreshIndex ( ) . then ( function ( index ) {
124
- index . addByPath ( fileName ) ;
125
- index . write ( ) ;
126
-
127
- return index . writeTree ( ) ;
129
+ return repository . refreshIndex ( )
130
+ . then ( function ( index ) {
131
+ return index . addByPath ( fileName )
132
+ . then ( function ( ) {
133
+ return index . write ( ) ;
134
+ } )
135
+ . then ( function ( ) {
136
+ return index . writeTree ( ) ;
137
+ } ) ;
128
138
} ) ;
129
139
} )
130
140
. then ( function ( oid ) {
@@ -170,12 +180,15 @@ fse.remove(path.resolve(__dirname, repoDir))
170
180
// we need to get a new index as the other one isnt backed to
171
181
// the repository in the usual fashion, and just behaves weirdly
172
182
. then ( function ( ) {
173
- return repository . refreshIndex ( ) . then ( function ( index ) {
174
-
175
- index . addByPath ( fileName ) ;
176
- index . write ( ) ;
177
-
178
- return index . writeTree ( ) ;
183
+ return repository . refreshIndex ( )
184
+ . then ( function ( index ) {
185
+ return index . addByPath ( fileName )
186
+ . then ( function ( ) {
187
+ return index . write ( ) ;
188
+ } )
189
+ . then ( function ( ) {
190
+ return index . writeTree ( ) ;
191
+ } ) ;
179
192
} ) ;
180
193
} )
181
194
. then ( function ( oid ) {
0 commit comments