File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 10
10
11
11
const request = require ( 'request' ) ;
12
12
const exec = require ( 'child_process' ) . exec ;
13
+ const execSync = require ( 'child_process' ) . execSync ;
13
14
const spawn = require ( 'child_process' ) . spawn ;
14
15
const inquirer = require ( 'inquirer' ) ;
15
16
const url = require ( 'url' ) ;
@@ -295,7 +296,11 @@ module.exports = function( grunt ) {
295
296
}
296
297
297
298
const uploadPatchWithCredentials = function ( username , password ) {
298
- const diffCommand = isSvn ( ) ? 'svn diff --diff-cmd diff' : 'git diff' ;
299
+ const diffCommand = isSvn ( ) ? 'svn diff --diff-cmd diff' : 'git diff HEAD' ;
300
+
301
+ if ( ! isSvn ( ) ) {
302
+ execSync ( 'git add .' ) ;
303
+ }
299
304
300
305
exec ( diffCommand , ( error , result ) => {
301
306
const client = xmlrpc . createSecureClient ( {
@@ -316,6 +321,10 @@ module.exports = function( grunt ) {
316
321
new Buffer ( new Buffer ( result ) . toString ( 'base64' ) , 'base64' ) ,
317
322
false , // never overwrite the old file
318
323
] , ( err ) => {
324
+ if ( ! isSvn ( ) ) {
325
+ exec ( 'git reset' ) ;
326
+ }
327
+
319
328
if ( null === err ) {
320
329
grunt . log . writeln ( 'Uploaded patch.' ) ;
321
330
done ( ) ;
You can’t perform that action at this time.
0 commit comments