Skip to content

Commit 1db069f

Browse files
author
Vicent Marti
committed
Merge pull request #574 from libgit2/arthur/fix-566
Test and fix for #566
2 parents 2b81013 + c47b8da commit 1db069f

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

test/revert_test.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def test_revert_with_conflicts
5252
end
5353

5454
def test_revert_orphan
55-
expected = [
55+
expected = [
5656
[0100644, "296a6d3be1dff05c5d1f631d2459389fa7b619eb", 0, "file-mainline.txt"]]
5757

5858
head = Rugged::Commit.lookup(@repo,"39467716290f6df775a91cdb9a4eb39295018145")
@@ -61,4 +61,13 @@ def test_revert_orphan
6161
index = @repo.revert_commit(revert, head)
6262
verify_index(index, expected)
6363
end
64+
65+
# GH-566
66+
def test_reverted_index_does_not_cause_segfault_on_diff
67+
head = Rugged::Commit.lookup(@repo,"39467716290f6df775a91cdb9a4eb39295018145")
68+
revert = Rugged::Commit.lookup(@repo, "ebb03002cee5d66c7732dd06241119fe72ab96a5")
69+
70+
index = @repo.revert_commit(revert, head)
71+
index.diff
72+
end
6473
end

0 commit comments

Comments
 (0)