mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 17:33:09 +00:00
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.
This commit is contained in:
parent
a4f1b93b95
commit
1b2e5b707a
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user