         textEditor.destroy()
         expect(currentPane.activate).toHaveBeenCalled()
         expect(fs.unlinkSync).toHaveBeenCalledWith commitFilePath
+
+    describe "when core.commentchar config is not set", ->
+      it "uses '#' in commit file", ->
+        setupMocks()
+        GitCommit(repo).start().then ->
+          argsTo_fsWriteFile = fs.writeFileSync.mostRecentCall.args
+          expect(argsTo_fsWriteFile[1].trim().charAt(0)).toBe '#'
+
+    describe "when core.commentchar config is set to '$'", ->
+      it "uses '$' as the commentchar", ->
+        commentchar_config = '$'
+        setupMocks()
+        GitCommit(repo).start().then ->
+          argsTo_fsWriteFile = fs.writeFileSync.mostRecentCall.args
+          expect(argsTo_fsWriteFile[1].trim().charAt(0)).toBe commentchar_config

  getItems: -> [
    getURI: -> commitFilePath
  ]

setupMocks = ->
  spyOn(currentPane, 'activate')


  spyOn(git, 'cmd').andCallFake ->
    args = git.cmd.mostRecentCall.args[0]
    if args[0] is 'config' and args[2] is 'commit.template'
      Promise.resolve ''
    else if args[0] is 'config' and args[2] is 'core.commentchar'
      Promise.resolve commentchar_config
    else if args[0] is 'status'
      Promise.resolve status
    else if args[0] is 'commit'
