Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Fix bug with gitExec #11

Open
wants to merge 1 commit into from

1 participant

Andrew Peace
Andrew Peace

I ran into a problem with this line here: https://github.com/creationix/node-git/blob/master/lib/git-fs.js#L139

It was throwing an error because gitExec requires all three arguments. I've fixed that by defaulting to "utf8" if no encoding is given

Maybe it's simpler just to add the "utf8" parameter to the getExec call I linked above, that's up to you. I figured I would share this fix anyway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Oct 21, 2012
Andrew Peace apeace Make encoding optional for gitExec ce3ab73
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 4 additions and 0 deletions. Show diff stats Hide diff stats

  1. +4 0 lib/git-fs.js
4 lib/git-fs.js
@@ -186,6 +186,10 @@ function getHeadSha(callback) {
186 186
187 187 // Internal helper to talk to the git subprocess
188 188 function gitExec(commands, encoding, callback) {
  189 + if (typeof callback === 'undefined') {
  190 + callback = encoding;
  191 + encoding = 'utf8';
  192 + }
189 193 commands = gitCommands.concat(commands);
190 194 var child = ChildProcess.spawn("git", commands);
191 195 var stdout = [], stderr = [];

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.