diff --git a/src/git_nested/discovery.py b/src/git_nested/discovery.py index 14afdc2d..92d609f2 100644 --- a/src/git_nested/discovery.py +++ b/src/git_nested/discovery.py @@ -67,7 +67,7 @@ def build_commit_message( commit = git.check_output(['rev-parse', '--short', nested_commit_ref]) message = textwrap.dedent( f"""\ - git nested {command} + git nested {command} {subdir.as_posix()} nested: subdir: "{subdir.as_posix()}" diff --git a/tests/e2e/scenarios/test_extraction.py b/tests/e2e/scenarios/test_extraction.py index f8f51c15..cebc500b 100644 --- a/tests/e2e/scenarios/test_extraction.py +++ b/tests/e2e/scenarios/test_extraction.py @@ -49,7 +49,7 @@ def test_usual_contribution(foo_bar_cloned_and_nested): author_email='foo@foo', committer_name='FooUser', committer_email='foo@foo', - commit_title='git nested pull', + commit_title='git nested pull bar', changed_files=['bar/.gitnested', 'bar/FirstBar', 'bar/SecondBar'], ) @@ -82,7 +82,7 @@ def test_usual_contribution(foo_bar_cloned_and_nested): author_email='foo@foo', committer_name='FooUser', committer_email='foo@foo', - commit_title='git nested pull', + commit_title='git nested pull bar', changed_files=[], ) assert_commit( @@ -155,7 +155,7 @@ def test_usual_contribution(foo_bar_cloned_and_nested): author_email='foo@foo', committer_name='FooUser', committer_email='foo@foo', - commit_title='git nested pull', + commit_title='git nested pull bar', changed_files=['bar/.gitnested', 'bar/SecondBar', 'bar/ThirdBar'], ) diff --git a/tests/e2e/test_patches.py b/tests/e2e/test_patches.py index a36a7390..e7455037 100644 --- a/tests/e2e/test_patches.py +++ b/tests/e2e/test_patches.py @@ -140,7 +140,7 @@ def test_pull_stops_at_a_patch_that_does_not_apply(foo_bar_cloned_and_nested): assert cmd_git_nested('patches verify bar', cwd=foo).output.strip().endswith(" with 1 patch") # The commit finishes the pull, so its message is the pull's message = env.run(['git', 'log', '-1', '--format=%B'], cwd=foo).stdout - assert message.startswith("git nested pull\n") + assert message.startswith("git nested pull bar\n") assert "Upstream commits:\n- " in message assert "upstream Bar" in message diff --git a/tests/e2e/test_pull.py b/tests/e2e/test_pull.py index 467ce56c..cc9e5b9a 100644 --- a/tests/e2e/test_pull.py +++ b/tests/e2e/test_pull.py @@ -52,7 +52,7 @@ def test_pull(prepare_pull_test): # Check commit messages foo_new_commit_message = git_get_commit_msg(env.workspace / 'foo').strip() assert foo_new_commit_message == textwrap.dedent(f'''\ - git nested pull + git nested pull bar nested: subdir: "bar" @@ -216,7 +216,7 @@ def test_pull_conflict(prepare_pull_test): upstream_log = env.run(['git', 'log', '-1', '--format=%h %s'], cwd=env.workspace / 'bar').stdout.strip() # The commit finishes the pull, so its message is the pull's assert foo_new_commit_message == textwrap.dedent(f'''\ - git nested pull + git nested pull bar nested: subdir: "bar" @@ -576,7 +576,7 @@ def test_pull_rebase(prepare_pull_test): foo_new_commit_message = git_get_commit_msg(env.workspace / 'foo').strip() bar_head_commit_short = git_rev_parse(['--short', bar_head_commit], cwd=env.workspace / 'foo') assert foo_new_commit_message == textwrap.dedent(f'''\ - git nested pull + git nested pull bar nested: subdir: "bar" @@ -653,7 +653,7 @@ def test_commit_after_a_rebase_conflict_says_pull(prepare_pull_test): cmd_git_nested('commit bar', cwd=foo) message = git_get_commit_msg(foo) - assert message.startswith("git nested pull\n") + assert message.startswith("git nested pull bar\n") upstream_log = env.run(['git', 'log', '-1', '--format=%h %s'], cwd=env.workspace / 'bar').stdout.strip() assert f"Upstream commits:\n- {upstream_log}" in message @@ -669,7 +669,7 @@ def test_commit_without_a_stopped_pull_says_commit(prepare_pull_test): env.run(['git', 'commit', '-qm', 'add Local'], cwd=worktree_dir) cmd_git_nested('commit bar', cwd=foo) - assert git_get_commit_msg(foo).startswith("git nested commit\n") + assert git_get_commit_msg(foo).startswith("git nested commit bar\n") def test_pull_with_force(prepare_pull_test): diff --git a/tests/e2e/test_push.py b/tests/e2e/test_push.py index cfdcaef7..afa3363f 100644 --- a/tests/e2e/test_push.py +++ b/tests/e2e/test_push.py @@ -68,7 +68,7 @@ def test_nested_push(foo_bar_cloned_and_nested): author_name='PushUser', committer_email='push@push', committer_name='PushUser', - commit_title='git nested pull', + commit_title='git nested pull bar', changed_files=[], ) assert_commit(