Skip to content

Commit 88d1b91

Browse files
committed
read git branch from config file before cloning repo
1 parent dcf433b commit 88d1b91

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

contrib/autogen/gen_diagrams_remote.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
chdir($workdir) || die("failed chdir");
1818
$output = null;
1919
$url = @$meta['git'];
20-
$cmd = sprintf('git clone --depth=1 %s %s', escapeshellarg($url), escapeshellarg($crate));
21-
shell($cmd) && die("git clone failed\n");
20+
$branch = @$meta['branch'];
21+
$branch_arg = $branch ? sprintf('--branch %s', escapeshellarg($branch)) : '';
22+
$cmd = sprintf('git clone %s --depth=1 %s %s', $branch_arg, escapeshellarg($url), escapeshellarg($crate));
23+
shell($cmd) && die("git clone failed\n command was: $cmd\n");
2224
$cratedir = $crate . '/' . @$meta['path'];
2325
$src_url_mask = "";
2426
if(strstr($url, "github.com")) {

0 commit comments

Comments
 (0)