Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions specfile/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,15 +400,13 @@ def guess_packager() -> str:
if shutil.which("git"):
email = subprocess.run(
["git", "config", "user.email"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True,
capture_output=True,
text=True,
).stdout.strip()
fullname = subprocess.run(
["git", "config", "user.name"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True,
capture_output=True,
text=True,
).stdout.strip()
if not fullname:
fullname = _getent_name()
Expand Down
10 changes: 3 additions & 7 deletions tests/unit/test_guess_packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,16 @@ def set_packager_git(monkeypatch: MonkeyPatch, tmp_path: Path) -> str:
packager = "Packager, Patty <packager@patty.dev>"

monkeypatch.chdir(tmp_path)
subprocess.run(
["git", "init", "."], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
subprocess.run(["git", "init", "."], check=True, capture_output=True)
subprocess.run(
["git", "config", "user.name", "Packager, Patty"],
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
capture_output=True,
)
subprocess.run(
["git", "config", "user.email", "packager@patty.dev"],
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
capture_output=True,
)
return packager

Expand Down