       wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures', 'master.git'), path.join(submoduleDirectory, '.git'))
 
       gitCommandHandler = jasmine.createSpy('gitCommandHandler')
-      exec "cd #{repoDirectory} && git submodule add #{submoduleDirectory} sub", gitCommandHandler
+      execCommands ["cd #{repoDirectory}", "git submodule add #{submoduleDirectory} sub"], gitCommandHandler
 
       waitsFor ->
         gitCommandHandler.callCount is 1

        fs.writeFileSync(filePath, 'first line is different', 'utf8')

        gitCommandHandler = jasmine.createSpy('gitCommandHandler')
        exec "cd #{repoDirectory} && git add a.txt", gitCommandHandler

        waitsFor ->
          gitCommandHandler.callCount is 1

wrench = require 'wrench'
temp = require 'temp'
_ = require 'underscore'

execCommands = (commands, callback) ->
  if process.platform is 'win32'
    command = commands.join(' & ')
  else
    command = commands.join(' && ')
  exec(command, callback)

describe "git", ->
  repo = null
