Skip to content
Snippets Groups Projects
Commit d89ffa5e2d7e authored by Georges Racinet's avatar Georges Racinet
Browse files

hooks: work from a share

We're going to need to send GitLab hooks from the temporary
working directories (shares) that are used in Rails to perform
operations. For that, the path to the Git repo must be inferred
from the share source path.
parent b4c4220047c0
No related branches found
No related tags found
1 merge request!21GitLab notification improvements
Pipeline #5622 passed
......@@ -6,6 +6,7 @@
# SPDX-License-Identifier: GPL-2.0-or-later
import os
import subprocess
from mercurial import hg
def git_hook_format_changes(changes):
......@@ -37,7 +38,10 @@
def __init__(self, name, repo):
self.name = name
self.repo = repo
self.git_fs_path = self.repo.root[:-3] + '.git'
main_repo = hg.sharedreposource(self.repo)
if main_repo is None:
main_repo = self.repo
self.git_fs_path = main_repo.root[:-3] + '.git'
shell = repo.ui.config(b'heptapod', b'gitlab-shell')
if not shell:
raise RuntimeError("Path to GitLab Shell is unknown")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment