From 1b2e5b707a65774df4f02fac321e1e1d19df537b Mon Sep 17 00:00:00 2001 From: ilian Date: Sun, 14 Feb 2021 16:47:33 +0100 Subject: [PATCH] vimPlugins: Ignore empty commits in update.py The result of repo.index.add() contains the list of files that have been added, even though they may be unchanged since the latest commit. We only commit if at least one file has changed. --- pkgs/misc/vim-plugins/update.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/misc/vim-plugins/update.py b/pkgs/misc/vim-plugins/update.py index b9bab293a79..f5d7434fe27 100755 --- a/pkgs/misc/vim-plugins/update.py +++ b/pkgs/misc/vim-plugins/update.py @@ -503,9 +503,9 @@ def parse_args(): def commit(repo: git.Repo, message: str, files: List[Path]) -> None: - files_staged = repo.index.add([str(f.resolve()) for f in files]) + repo.index.add([str(f.resolve()) for f in files]) - if files_staged: + if repo.index.diff("HEAD"): print(f'committing to nixpkgs "{message}"') repo.index.commit(message) else: