From fd590b9c483b35fb262ee235c4ee84882fe94ac2 Mon Sep 17 00:00:00 2001 From: Enno Boland Date: Mon, 30 Oct 2017 18:53:06 +0100 Subject: [PATCH] git.js: allow quotes in git_directory --- lib/git/git.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git/git.js b/lib/git/git.js index 78bfce2..746d181 100644 --- a/lib/git/git.js +++ b/lib/git/git.js @@ -226,7 +226,7 @@ Git.prototype.call_git = function(prefix, command, gitargs, postfix, options, ar // Join the arguments var final_arguments = option_arguments.concat(ext_args); // Build a call - call_string = prefix + Git.git_binary + ' --git-dir="'+ this.git_directory + '" ' + ext_git_args + command.toString().replace(/_/, '-') + ' ' + final_arguments.join(" ") + postfix; + call_string = prefix + Git.git_binary + ' --git-dir="' + shell_escape(this.git_directory) + '" ' + ext_git_args + command.toString().replace(/_/, '-') + ' ' + final_arguments.join(" ") + postfix; } // Execute the function this.exec(call_string, { encoding: 'utf8', timeout: timeout, killSignal: 'SIGKILL'}, callback);