##// END OF EJS Templates
feat(git): added update_refs method that validate refs before settings a value
super-admin -
r1191:3687e783 default
parent child Browse files
Show More
@@ -1101,6 +1101,14 b' class GitRemote(RemoteBase):'
1101 1101 repo.references.create(key, value, force=True)
1102 1102
1103 1103 @reraise_safe_exceptions
1104 def update_refs(self, wire, key, value):
1105 repo_init = self._factory.repo_libgit2(wire)
1106 with repo_init as repo:
1107 if key not in repo.references:
1108 raise ValueError(f'Reference {key} not found in the repository')
1109 repo.references.create(key, value, force=True)
1110
1111 @reraise_safe_exceptions
1104 1112 def create_branch(self, wire, branch_name, commit_id, force=False):
1105 1113 repo_init = self._factory.repo_libgit2(wire)
1106 1114 with repo_init as repo:
General Comments 0
You need to be logged in to leave comments. Login now