Skip to content

Commit 934d17d

Browse files
committed
Add test for properly escaping double quote on Windows
Signed-off-by: James Couball <jcouball@yahoo.com>
1 parent db060fc commit 934d17d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env ruby
2+
# encoding: utf-8
3+
4+
require File.dirname(__FILE__) + '/../test_helper'
5+
6+
# Test diff when the file path has to be quoted according to core.quotePath
7+
# See https://git-scm.com/docs/git-config#Documentation/git-config.txt-corequotePath
8+
#
9+
class TestWindowsCmdEscaping < Test::Unit::TestCase
10+
def test_commit_with_double_quote_in_commit_message
11+
expected_commit_message = 'Commit message with "double quotes"'
12+
in_temp_dir do |path|
13+
create_file('README.md', "# README\n")
14+
git = Git.init('.')
15+
git.add
16+
git.commit(expected_commit_message)
17+
commits = git.log(1)
18+
actual_commit_message = commits.first.message
19+
assert_equal(expected_commit_message, actual_commit_message)
20+
end
21+
end
22+
end

0 commit comments

Comments
 (0)