From 13e34b400abb509fd108332a007b2f6638361eb9 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Mon, 11 Jun 2018 17:48:24 +0200 Subject: [PATCH] Add support for commondir file in .git dir - See : https://git-scm.com/docs/gitrepository-layout/2.5.1 - See : https://git-scm.com/docs/gitrepository-layout Closes: #14391 Signed-off-by: William Desportes --- libraries/classes/Config.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/classes/Config.php b/libraries/classes/Config.php index 093b20b5496e..49e27a563313 100644 --- a/libraries/classes/Config.php +++ b/libraries/classes/Config.php @@ -436,6 +436,10 @@ public function checkGitRevision(): void return; } + if ($common_dir_contents = @file_get_contents($git_folder . '/commondir')) { + $git_folder = $git_folder.DIRECTORY_SEPARATOR.trim($common_dir_contents); + } + $branch = false; // are we on any branch? if (strstr($ref_head, '/')) {