Skip to content

Commit 97f4d1e

Browse files
committed
cmd/git(fix[GitNoteCmd]): fix hanging doctest and pass kwargs through run()
why: The doctest for GitNoteCmd.edit hung because: 1. git notes edit opens an interactive editor 2. GitNoteCmd.run() wasn't passing **kwargs to self.cmd.run() so config={'core.editor': 'true'} was being dropped what: - Use config={'core.editor': 'true'} to override editor via -c flag - Pass **kwargs through GitNoteCmd.run() to self.cmd.run()
1 parent 4019a1e commit 97f4d1e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/libvcs/cmd/git.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6893,6 +6893,7 @@ def run(
68936893
["notes", *local_flags],
68946894
check_returncode=check_returncode,
68956895
log_in_real_time=log_in_real_time,
6896+
**kwargs,
68966897
)
68976898

68986899
def show(
@@ -7012,6 +7013,7 @@ def edit(
70127013
# Pass-through to run()
70137014
log_in_real_time: bool = False,
70147015
check_returncode: bool | None = None,
7016+
**kwargs: t.Any,
70157017
) -> str:
70167018
"""Edit the note for this object.
70177019
@@ -7025,10 +7027,12 @@ def edit(
70257027
70267028
Examples
70277029
--------
7030+
Use config to override editor (avoids interactive editor):
7031+
70287032
>>> result = GitNoteCmd(
70297033
... path=example_git_repo.path,
70307034
... object_sha='HEAD',
7031-
... ).edit(allow_empty=True)
7035+
... ).edit(allow_empty=True, config={'core.editor': 'true'})
70327036
>>> 'error' in result.lower() or result == ''
70337037
True
70347038
"""
@@ -7044,6 +7048,7 @@ def edit(
70447048
local_flags=local_flags,
70457049
check_returncode=check_returncode,
70467050
log_in_real_time=log_in_real_time,
7051+
**kwargs,
70477052
)
70487053

70497054
def copy(

0 commit comments

Comments
 (0)