From ce3ab7305dce375dd7143b5458c1205537fdfc9a Mon Sep 17 00:00:00 2001 From: Andrew Peace Date: Sun, 21 Oct 2012 12:26:02 -0400 Subject: [PATCH] Make encoding optional for gitExec --- lib/git-fs.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/git-fs.js b/lib/git-fs.js index a8be53c..0545945 100755 --- a/lib/git-fs.js +++ b/lib/git-fs.js @@ -186,6 +186,10 @@ function getHeadSha(callback) { // Internal helper to talk to the git subprocess function gitExec(commands, encoding, callback) { + if (typeof callback === 'undefined') { + callback = encoding; + encoding = 'utf8'; + } commands = gitCommands.concat(commands); var child = ChildProcess.spawn("git", commands); var stdout = [], stderr = [];