summaryrefslogtreecommitdiffstats
path: root/tests/commands/install_uninstall_test.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-19 10:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-19 10:19:03 +0000
commitccce8747ac9170ce98d535ef527caa8867e5eef4 (patch)
tree6271d025d1f560e64d494c7a609daf2ba3e0f048 /tests/commands/install_uninstall_test.py
parentAdding upstream version 3.1.1. (diff)
downloadpre-commit-ccce8747ac9170ce98d535ef527caa8867e5eef4.tar.xz
pre-commit-ccce8747ac9170ce98d535ef527caa8867e5eef4.zip
Adding upstream version 3.2.0.upstream/3.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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 = {