fixed: handling cases where there is no remote branch

https://github.com/ltdrdata/ComfyUI-Manager/issues/1443
This commit is contained in:
Dr.Lt.Data
2025-01-13 06:22:11 +09:00
parent 897debb106
commit c779573204
3 changed files with 20 additions and 6 deletions

View File

@@ -195,7 +195,11 @@ def gitpull(path):
branch_name = current_branch.name
remote.fetch()
remote_commit_hash = repo.refs[f'{remote_name}/{branch_name}'].object.hexsha
if f'{remote_name}/{branch_name}' in repo.refs:
remote_commit_hash = repo.refs[f'{remote_name}/{branch_name}'].object.hexsha
else:
print("CUSTOM NODE PULL: Fail") # update fail
return
if commit_hash == remote_commit_hash:
print("CUSTOM NODE PULL: None") # there is no update