зеркало из https://github.com/github/grit.git
Merge commit 'bfe14d6403fd701cb131'
This commit is contained in:
Коммит
3b94889cab
|
@ -502,7 +502,7 @@ module Grit
|
|||
diff = self.git.native('diff', {}, a, b, '--', *paths)
|
||||
|
||||
if diff =~ /diff --git a/
|
||||
diff = diff.sub(/.+?(diff --git a)/m, '\1')
|
||||
diff = diff.sub(/.*?(diff --git a)/m, '\1')
|
||||
else
|
||||
diff = ''
|
||||
end
|
||||
|
|
|
@ -234,6 +234,13 @@ class TestRepo < Test::Unit::TestCase
|
|||
@r.diff('master^', 'master', 'foo/bar', 'foo/baz')
|
||||
end
|
||||
|
||||
def test_diff2
|
||||
Git.any_instance.expects(:native).with('diff', {}, 'a', 'b', '--').returns(fixture('diff_p'))
|
||||
diffs = @r.diff('a', 'b')
|
||||
|
||||
assert_equal 15, diffs.size
|
||||
end
|
||||
|
||||
# commit_diff
|
||||
|
||||
def test_diff
|
||||
|
|
Загрузка…
Ссылка в новой задаче