Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix diffs of files that have quoted paths
Signed-off-by: James Couball <jcouball@yahoo.com>
- Loading branch information
Showing
4 changed files
with
52 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require File.dirname(__FILE__) + '/../test_helper' | ||
|
||
# Test diff when the file path has to be quoted according to core.quotePath | ||
# See https://git-scm.com/docs/git-config#Documentation/git-config.txt-corequotePath | ||
# | ||
class TestDiffWithQuotedPath < Test::Unit::TestCase | ||
def test_diff_with_non_ascii_filename | ||
in_temp_dir do |path| | ||
create_file('my_other_file_☠', "First Line\n") | ||
`git init` | ||
`git add .` | ||
`git commit -m "First Commit"` | ||
update_file('my_other_file_☠', "Second Line\n") | ||
diff_paths = Git.open('.').diff.map(&:path) | ||
assert_equal(diff_paths, ['my_other_file_☠']) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters