diff --git a/src/git.coffee b/src/git.coffee index 9ae188a..8669b05 100644 --- a/src/git.coffee +++ b/src/git.coffee @@ -12,7 +12,10 @@ module.exports = Git = (git_dir, dot_git, git_options) -> options = options_to_argv options options = options.join " " args ?= [] - args = args.join " " if args instanceof Array + if args instanceof Array + shell_args = for arg in args + arg.replace(/(["\s'$`\\])/g,'\\$1') + args = shell_args.join " " encoding ?= 'utf8' bash = "#{git_options.bin || Git.bin} #{command} #{options} #{args}" exec bash, { diff --git a/src/repo.coffee b/src/repo.coffee index 3c0e2be..06864e0 100644 --- a/src/repo.coffee +++ b/src/repo.coffee @@ -44,10 +44,10 @@ module.exports = class Repo # identify: (actor, callback) -> # git config user.email "you@example.com" - @git "config", {}, ["user.email", "\"#{actor.email}\""], (err) => + @git "config", {}, ["user.email", "#{actor.email}"], (err) => return callback err if err # git config user.name "Your Name" - @git "config", {}, ["user.name", "\"#{actor.name}\""], (err) => + @git "config", {}, ["user.name", "#{actor.name}"], (err) => return callback err if err return callback null diff --git a/test/repo.test.coffee b/test/repo.test.coffee index a0ce37b..44bc43e 100644 --- a/test/repo.test.coffee +++ b/test/repo.test.coffee @@ -18,7 +18,7 @@ describe "Repo", -> describe "#add", -> repo = null - git_dir = __dirname + "/fixtures/junk_add" + git_dir = __dirname + "/fixtures/junk _$add" status = null file = null