summaryrefslogtreecommitdiffstats
path: root/tests/commands/install_uninstall_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/commands/install_uninstall_test.py')
-rw-r--r--tests/commands/install_uninstall_test.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/commands/install_uninstall_test.py b/tests/commands/install_uninstall_test.py
index a1ecda8..8b0d3ec 100644
--- a/tests/commands/install_uninstall_test.py
+++ b/tests/commands/install_uninstall_test.py
@@ -810,6 +810,46 @@ def test_post_merge_integration(tempdir_factory, store):
assert os.path.exists('post-merge.tmp')
+def test_pre_rebase_integration(tempdir_factory, store):
+ path = git_dir(tempdir_factory)
+ config = {
+ 'repos': [
+ {
+ 'repo': 'local',
+ 'hooks': [{
+ 'id': 'pre-rebase',
+ 'name': 'Pre rebase',
+ 'entry': 'touch pre-rebase.tmp',
+ 'language': 'system',
+ 'always_run': True,
+ 'verbose': True,
+ 'stages': ['pre-rebase'],
+ }],
+ },
+ ],
+ }
+ write_config(path, config)
+ with cwd(path):
+ install(C.CONFIG_FILE, store, hook_types=['pre-rebase'])
+ open('foo', 'a').close()
+ cmd_output('git', 'add', '.')
+ git_commit()
+
+ cmd_output('git', 'checkout', '-b', 'branch')
+ open('bar', 'a').close()
+ cmd_output('git', 'add', '.')
+ git_commit()
+
+ cmd_output('git', 'checkout', 'master')
+ open('baz', 'a').close()
+ cmd_output('git', 'add', '.')
+ git_commit()
+
+ cmd_output('git', 'checkout', 'branch')
+ cmd_output('git', 'rebase', 'master', 'branch')
+ assert os.path.exists('pre-rebase.tmp')
+
+
def test_post_rewrite_integration(tempdir_factory, store):
path = git_dir(tempdir_factory)
config = {