|
@@ -20,6 +20,7 @@
|
|
|
from cStringIO import StringIO
|
|
|
import stat
|
|
|
|
|
|
+
|
|
|
from dulwich.object_store import (
|
|
|
MemoryObjectStore,
|
|
|
)
|
|
@@ -35,6 +36,9 @@ from dulwich.tests import (
|
|
|
SkipTest,
|
|
|
TestCase,
|
|
|
)
|
|
|
+from dulwich.tests.utils import (
|
|
|
+ build_commit_graph,
|
|
|
+ )
|
|
|
|
|
|
|
|
|
class GitFastExporterTests(TestCase):
|
|
@@ -96,6 +100,13 @@ class GitImportProcessorTests(TestCase):
|
|
|
raise SkipTest("python-fastimport not available")
|
|
|
self.processor = GitImportProcessor(self.repo)
|
|
|
|
|
|
+ def test_reset_handler(self):
|
|
|
+ from fastimport import commands
|
|
|
+ [c1] = build_commit_graph(self.repo.object_store, [[1]])
|
|
|
+ cmd = commands.ResetCommand("refs/heads/foo", c1.id)
|
|
|
+ self.processor.reset_handler(cmd)
|
|
|
+ self.assertEquals(c1.id, self.repo.get_refs()["refs/heads/foo"])
|
|
|
+
|
|
|
def test_commit_handler(self):
|
|
|
from fastimport import commands
|
|
|
cmd = commands.CommitCommand("refs/heads/foo", "mrkr",
|