mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-01-06 15:15:05 +08:00
Better checking of extension state from Git info
This commit is contained in:
parent
ad5afcaae0
commit
f22d0dde4e
@ -91,9 +91,20 @@ class Extension:
|
|||||||
for fetch in repo.remote().fetch(dry_run=True):
|
for fetch in repo.remote().fetch(dry_run=True):
|
||||||
if fetch.flags != fetch.HEAD_UPTODATE:
|
if fetch.flags != fetch.HEAD_UPTODATE:
|
||||||
self.can_update = True
|
self.can_update = True
|
||||||
self.status = "behind"
|
self.status = "new commits"
|
||||||
return
|
return
|
||||||
|
|
||||||
|
try:
|
||||||
|
origin = repo.rev_parse('origin')
|
||||||
|
if repo.head.commit != origin:
|
||||||
|
self.can_update = True
|
||||||
|
self.status = "behind HEAD"
|
||||||
|
return
|
||||||
|
except Exception:
|
||||||
|
self.can_update = False
|
||||||
|
self.status = "unknown (remote error)"
|
||||||
|
return
|
||||||
|
|
||||||
self.can_update = False
|
self.can_update = False
|
||||||
self.status = "latest"
|
self.status = "latest"
|
||||||
|
|
||||||
@ -103,6 +114,7 @@ class Extension:
|
|||||||
# because WSL2 Docker set 755 file permissions instead of 644, this results to the error.
|
# because WSL2 Docker set 755 file permissions instead of 644, this results to the error.
|
||||||
repo.git.fetch(all=True)
|
repo.git.fetch(all=True)
|
||||||
repo.git.reset(commit, hard=True)
|
repo.git.reset(commit, hard=True)
|
||||||
|
self.have_info_from_repo = False
|
||||||
|
|
||||||
|
|
||||||
def list_extensions():
|
def list_extensions():
|
||||||
|
Loading…
Reference in New Issue
Block a user