about summary refs log tree commit diff
path: root/maintainers/scripts
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2021-10-31 10:55:37 +0100
committerJan Tojnar <jtojnar@gmail.com>2021-10-31 11:00:37 +0100
commita20a4af62aee6f338f81cd16e988bea3878adf59 (patch)
treecdc4481d1e30ff1920863604771dcf23957119c9 /maintainers/scripts
parentf270c529ce51cb462db2331629dcee64879dfdf5 (diff)
downloadnixlib-a20a4af62aee6f338f81cd16e988bea3878adf59.tar
nixlib-a20a4af62aee6f338f81cd16e988bea3878adf59.tar.gz
nixlib-a20a4af62aee6f338f81cd16e988bea3878adf59.tar.bz2
nixlib-a20a4af62aee6f338f81cd16e988bea3878adf59.tar.lz
nixlib-a20a4af62aee6f338f81cd16e988bea3878adf59.tar.xz
nixlib-a20a4af62aee6f338f81cd16e988bea3878adf59.tar.zst
nixlib-a20a4af62aee6f338f81cd16e988bea3878adf59.zip
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.
Diffstat (limited to 'maintainers/scripts')
-rw-r--r--maintainers/scripts/update.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/maintainers/scripts/update.py b/maintainers/scripts/update.py
index eb26a472e926..06b12a0ee04e 100644
--- a/maintainers/scripts/update.py
+++ b/maintainers/scripts/update.py
@@ -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'))
 
         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()
             changes[0]['files'] = changed_files