GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — refactor(git.py): Removed 'extra_args' from git.commit · commitizen-tools/commitizen@12b214e

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • commitizen
    • commands
      • commit.py
    • git.py
  • tests/commands
    • test_commit_command.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎commitizen/commands/commit.py‎

Copy file name to clipboardExpand all lines: commitizen/commands/commit.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def __call__(self):
105105
else:
106106
extra_args = self.arguments.get("extra_cli_args", "")
107107

108-
c = git.commit(m, extra_args=extra_args)
108+
c = git.commit(m, args=extra_args)
109109

110110
if c.return_code != 0:
111111
out.error(c.err)
Collapse file

‎commitizen/git.py‎

Copy file name to clipboardExpand all lines: commitizen/git.py
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,13 @@ def add(args: str = "") -> cmd.Command:
100100
def commit(
101101
message: str,
102102
args: str = "",
103-
extra_args: str = "",
104103
committer_date: str | None = None,
105104
) -> cmd.Command:
106105
f = NamedTemporaryFile("wb", delete=False)
107106
f.write(message.encode("utf-8"))
108107
f.close()
109108

110-
command = f"git commit {args} {extra_args} -F {f.name}"
109+
command = f"git commit {args} -F {f.name}"
111110

112111
if committer_date and os.name == "nt": # pragma: no cover
113112
# Using `cmd /v /c "{command}"` sets environment variables only for that command
Collapse file

‎tests/commands/test_commit_command.py‎

Copy file name to clipboardExpand all lines: tests/commands/test_commit_command.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def test_commit_retry_works(config, mocker: MockFixture):
8888

8989
commands.Commit(config, {"retry": True})()
9090

91-
commit_mock.assert_called_with("feat: user created\n\ncloses #21", extra_args="")
91+
commit_mock.assert_called_with("feat: user created\n\ncloses #21", args="")
9292
prompt_mock.assert_called_once()
9393
success_mock.assert_called_once()
9494
assert not os.path.isfile(temp_file)
@@ -174,7 +174,7 @@ def test_commit_command_with_signoff_option(config, mocker: MockFixture):
174174

175175
commands.Commit(config, {"signoff": True})()
176176

177-
commit_mock.assert_called_once_with(ANY, extra_args="-- -s")
177+
commit_mock.assert_called_once_with(ANY, args="-- -s")
178178
success_mock.assert_called_once()
179179

180180

@@ -197,7 +197,7 @@ def test_commit_command_with_always_signoff_enabled(config, mocker: MockFixture)
197197
config.settings["always_signoff"] = True
198198
commands.Commit(config, {})()
199199

200-
commit_mock.assert_called_once_with(ANY, extra_args="-- -s")
200+
commit_mock.assert_called_once_with(ANY, args="-- -s")
201201
success_mock.assert_called_once()
202202

203203

@@ -294,5 +294,5 @@ def test_commit_command_with_extra_args(config, mocker: MockFixture):
294294
commit_mock.return_value = cmd.Command("success", "", b"", b"", 0)
295295
success_mock = mocker.patch("commitizen.out.success")
296296
commands.Commit(config, {"extra_cli_args": "-- -extra-args1 -extra-arg2"})()
297-
commit_mock.assert_called_once_with(ANY, extra_args="-- -extra-args1 -extra-arg2")
297+
commit_mock.assert_called_once_with(ANY, args="-- -extra-args1 -extra-arg2")
298298
success_mock.assert_called_once()

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.