mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 04:05:40 +03:00
maintainers/scripts/update.nix: Support committing with nix-update-script
When updating a package using nix-update-script with `--argstr commit true`, update.nix would not detect the changes because nix-update would stage them and `git diff` would be empty. We now detect both staged and unstaged changes to handle this use case.
This commit is contained in:
parent
f270c529ce
commit
a20a4af62a
1 changed files with 1 additions and 1 deletions
|
@ -114,7 +114,7 @@ async def check_changes(package: Dict, worktree: str, update_info: str):
|
||||||
changes[0]['newVersion'] = json.loads((await obtain_new_version_process.stdout.read()).decode('utf-8'))
|
changes[0]['newVersion'] = json.loads((await obtain_new_version_process.stdout.read()).decode('utf-8'))
|
||||||
|
|
||||||
if 'files' not in changes[0]:
|
if 'files' not in changes[0]:
|
||||||
changed_files_process = await check_subprocess('git', 'diff', '--name-only', stdout=asyncio.subprocess.PIPE, cwd=worktree)
|
changed_files_process = await check_subprocess('git', 'diff', '--name-only', 'HEAD', stdout=asyncio.subprocess.PIPE, cwd=worktree)
|
||||||
changed_files = (await changed_files_process.stdout.read()).splitlines()
|
changed_files = (await changed_files_process.stdout.read()).splitlines()
|
||||||
changes[0]['files'] = changed_files
|
changes[0]['files'] = changed_files
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue