Skip to content

Commit 47e9244

Browse files
authored
envoy.base.utils(0.5.8): Fix project commit escape (#2536)
Signed-off-by: Ryan Northey <[email protected]>
1 parent d074c60 commit 47e9244

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

envoy.base.utils/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.5.8-dev
1+
0.5.8

envoy.base.utils/envoy/base/utils/abstract/project/project.py

+1
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ async def _git_commit(
350350
else [])
351351
await self._exec(
352352
" ".join(("git", "add", *changed)))
353+
msg = msg.replace("'", r"\'")
353354
await self._exec(
354355
" ".join((
355356
"git", "commit", *author_args, *changed,

envoy.base.utils/tests/test_abstract_project.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1072,8 +1072,13 @@ async def test_abstract_project__git_commit(iters, patches):
10721072
m_exec.call_args_list
10731073
== [[(" ".join(["git", "add", *changed]), ),
10741074
{}],
1075-
[(" ".join(["git", "commit", *changed, "-m", f"'{msg}'"]), ),
1075+
[(" ".join([
1076+
"git", "commit", *changed,
1077+
"-m", f"'{msg.replace.return_value}'"]), ),
10761078
{}]])
1079+
assert (
1080+
msg.replace.call_args
1081+
== [("'", r"\'"), {}])
10771082

10781083

10791084
@pytest.mark.parametrize("returns", [None, 0, 23, "cabbage"])

0 commit comments

Comments
 (0)