diff options
author | Erik Fonnesbeck <efonnes@gmail.com> | 2010-08-05 00:48:26 -0600 |
---|---|---|
committer | Erik Fonnesbeck <efonnes@gmail.com> | 2010-08-05 00:50:43 -0600 |
commit | fb95b3244ad91a974db84645f2fd3cdcb7d60eab (patch) | |
tree | f060788bd3c74bb038687c3053c69d694070964c /etc/phpshellsessions | |
parent | 5624039060c831d16bf7422bbfa8659539bd96d8 (diff) | |
download | pfsense-fb95b3244ad91a974db84645f2fd3cdcb7d60eab.zip pfsense-fb95b3244ad91a974db84645f2fd3cdcb7d60eab.tar.gz |
Allow specifying other branches when using the existing repository URL in gitsync after the branches have been downloaded for the first time.
Diffstat (limited to 'etc/phpshellsessions')
-rw-r--r-- | etc/phpshellsessions/gitsync | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/etc/phpshellsessions/gitsync b/etc/phpshellsessions/gitsync index 39c51ce..5e2aead 100644 --- a/etc/phpshellsessions/gitsync +++ b/etc/phpshellsessions/gitsync @@ -79,6 +79,18 @@ if($argv[4] == "NOBACKUP") else $nobackup = false; +// If the repository has been fetched before, build a list of its branches. +if(is_dir("$CODIR/pfSenseGITREPO/pfSenseGITREPO")) { + exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git branch -r", $branch_list, $ret); + if($ret == 0 && is_array($branch_list)) { + foreach ($branch_list as $branch_item) { + $branch_item = substr(strrchr($branch_item, "/"), 1); + if (!isset($branches[$branch_item])) + $branches[$branch_item] = " "; + } + } +} + $found = false; foreach($branches as $branchname => $branchdesc) { if($branchname == $branch) |