@@ -6,6 +6,7 @@ var gulp = require('gulp');
66var git = require ( 'gulp-git' ) ;
77var process = require ( 'process' ) ;
88var minimist = require ( 'minimist' ) ;
9+ var child_process = require ( 'child_process' ) ;
910
1011exports . init = function ( rawGitArgs , environment , config ) {
1112 if ( typeof environment === 'undefined' ) {
@@ -63,20 +64,14 @@ function withoutConfig(rawGitArgs, environment) {
6364 if ( environment . debug === true ) {
6465 console . error ( 'COMMITIZEN DEBUG: No git-cz friendly config was detected. I looked for .czrc, .cz.json, or czConfig in package.json.' ) ;
6566 } else {
66- // Get a gulp stream based off the config
67- gulp . src ( process . cwd ( ) )
67+ var vanillaGitArgs = [ "commit" ] . concat ( rawGitArgs ) ;
6868
69- // Format then commit
70- . pipe ( git . commit ( undefined , { args : rawGitArgs , disableMessageRequirement : true } ) )
71-
72- // Handle commit success
73- . on ( 'end' , function ( ) {
74- console . log ( '✓ Commit succeeded.' ) ;
75- } )
69+ var child = child_process . spawn ( 'git' , vanillaGitArgs , {
70+ stdio : 'inherit'
71+ } ) ;
7672
77- // Handle commit failure
78- . on ( 'error' , function ( error ) {
79- console . error ( '✗ Commit failed. Did you forget to \'git add\' your files or add a commit message?' ) ;
73+ child . on ( 'error' , function ( e , code ) {
74+ console . error ( e ) ;
8075 } ) ;
8176 }
8277}
0 commit comments