1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-16 12:55:09 +03:00

pmbootstrap status: check if git repo is outdated (!1882)

Use the timestamp of .git/FETCH_HEAD in each git repository, to
determine if too much time has passed since the last fetch/pull.
Modify pmb.helpers.git.clone, so FETCH_HEAD is always created if it does
not exist (because "git clone" would not create it).

Related: #1829
This commit is contained in:
Oliver Smith 2020-02-12 22:44:26 +01:00 committed by Alexey Min
parent c8526f2fcb
commit cfd93bc6ea
No known key found for this signature in database
GPG key ID: 0B19D2A65870B448
5 changed files with 79 additions and 13 deletions

View file

@ -83,3 +83,10 @@ def test_print_checks_git_repo(args, monkeypatch, tmpdir):
run_git(["pull"])
status, _ = func(args, name_repo)
assert status == 0
# Outdated remote information
def is_outdated(args, path):
return True
monkeypatch.setattr(pmb.helpers.git, "is_outdated", is_outdated)
status, _ = func(args, name_repo)
assert status == -5