aboutsummaryrefslogtreecommitdiff
path: root/gitosis/test/test_repository.py
diff options
context:
space:
mode:
authorTommi Virtanen <tv@eagain.net>2007-12-31 19:30:27 +0200
committerTommi Virtanen <tv@eagain.net>2007-12-31 19:30:27 +0200
commit895fd8b7ad0766f5c320befa221fa7e4cdacfc71 (patch)
tree0dc1cb73e60087be1a56cdf2a3f9d9a2433a5563 /gitosis/test/test_repository.py
parentDon't always init repository when doing fast-import. (diff)
downloadgitosis-dakkar-895fd8b7ad0766f5c320befa221fa7e4cdacfc71.tar.gz
gitosis-dakkar-895fd8b7ad0766f5c320befa221fa7e4cdacfc71.tar.bz2
gitosis-dakkar-895fd8b7ad0766f5c320befa221fa7e4cdacfc71.zip
Allow using fast_import for more than initial commit.
Diffstat (limited to 'gitosis/test/test_repository.py')
-rw-r--r--gitosis/test/test_repository.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/gitosis/test/test_repository.py b/gitosis/test/test_repository.py
index b7338e5..6ce4129 100644
--- a/gitosis/test/test_repository.py
+++ b/gitosis/test/test_repository.py
@@ -313,3 +313,31 @@ exec git "$@"
got = readFile(os.path.join(tmp, 'cookie'))
eq(got, magic_cookie)
+def test_fast_import_parent():
+ tmp = maketemp()
+ path = os.path.join(tmp, 'repo.git')
+ repository.init(path=path)
+ repository.fast_import(
+ git_dir=path,
+ commit_msg='foo initial bar',
+ committer='Mr. Unit Test <unit.test@example.com>',
+ files=[
+ ('foo', 'bar\n'),
+ ],
+ )
+ repository.fast_import(
+ git_dir=path,
+ commit_msg='another',
+ committer='Sam One Else <sam@example.com>',
+ parent='refs/heads/master^0',
+ files=[
+ ('quux', 'thud\n'),
+ ],
+ )
+ export = os.path.join(tmp, 'export')
+ repository.export(
+ git_dir=path,
+ path=export,
+ )
+ eq(sorted(os.listdir(export)),
+ sorted(['foo', 'quux']))