##// END OF EJS Templates
git: allow setting symbolic ref for repos without master branch....
super-admin -
r965:7597323f default
parent child Browse files
Show More
@@ -595,7 +595,7 b' class GitRemote(RemoteBase):'
595
595
596 if refs and not update_after:
596 if refs and not update_after:
597 # mikhail: explicitly set the head to the last ref.
597 # mikhail: explicitly set the head to the last ref.
598 repo['HEAD'] = remote_refs[refs[-1]]
598 repo["HEAD"] = remote_refs[refs[-1]]
599
599
600 if update_after:
600 if update_after:
601 # we want to checkout HEAD
601 # we want to checkout HEAD
@@ -1203,6 +1203,13 b' class GitRemote(RemoteBase):'
1203 return install_git_hooks(path, bare, force_create=force)
1203 return install_git_hooks(path, bare, force_create=force)
1204
1204
1205 @reraise_safe_exceptions
1205 @reraise_safe_exceptions
1206 def set_head_ref(self, wire, head_name):
1207 log.debug('Setting refs/head to `%s`', head_name)
1208 cmd = ['symbolic-ref', 'HEAD', 'refs/heads/%s' % head_name]
1209 output, __ = self.run_git_command(wire, cmd)
1210 return [head_name] + output.splitlines()
1211
1212 @reraise_safe_exceptions
1206 def get_hooks_info(self, wire):
1213 def get_hooks_info(self, wire):
1207 from vcsserver.hook_utils import (
1214 from vcsserver.hook_utils import (
1208 get_git_pre_hook_version, get_git_post_hook_version)
1215 get_git_pre_hook_version, get_git_post_hook_version)
General Comments 0
You need to be logged in to leave comments. Login now