var map = require("map-stream");
var gutil = require("gulp-util");
var exec = require("child_process").exec;
var escape = require("any-shell-escape");

module.exports = function (opt) {
  if(!opt) opt = {};
  if(!opt.args) opt.args = ' ';

  function add(file, cb) {
    var cmd = "git add " + escape([file.path]) + " " + opt.args;
    exec(cmd, {cwd: file.cwd}, function(err, stdout, stderr){
      if(err) cb(err);
      gutil.log(stdout, stderr);
      cb(null, file);
    });
  }

  // Return a stream
  return map(add);
};

@@ -260,16 +260,51 @@
 , cb) %7B%0A
+    var cwd = opt.cwd %7C%7C fileCwd;%0A%0A
     var 
@@ -380,21 +380,16 @@
 , %7Bcwd: 
-file.
 cwd%7D, fu

allow git.add() to use cwd as an option