summaryrefslogtreecommitdiffstats
path: root/gitmirror
diff options
context:
space:
mode:
Diffstat (limited to 'gitmirror')
-rwxr-xr-xgitmirror/filter-branches.pl13
-rwxr-xr-xgitmirror/robot.sh2
2 files changed, 11 insertions, 4 deletions
diff --git a/gitmirror/filter-branches.pl b/gitmirror/filter-branches.pl
index 81588cf..cc08869 100755
--- a/gitmirror/filter-branches.pl
+++ b/gitmirror/filter-branches.pl
@@ -1,10 +1,17 @@
#!/usr/bin/perl
-open(GIT, "-|", "git branch -r") or die;
+$rem = shift @ARGV;
+if (defined($rem)) {
+ $remopt = '-r';
+}
+open(GIT, "-|", "git branch $remopt") or die;
%branches = ();
while (<GIT>) {
chomp;
- next if (!m:^[ \*] origin/:);
- s:^[ \*] origin/::;
+ s:^[ \*] ::;
+ if (defined($rem)) {
+ next if (substr($_,0,length($rem)+1) ne $rem.'/');
+ $_ = substr($_,length($rem)+1);
+ }
next if (/ \-\> /);
next if (/^\s*(\#.*|)$/);
next if (/^(HEAD|build)$/);
diff --git a/gitmirror/robot.sh b/gitmirror/robot.sh
index ea76707..0b0b31c 100755
--- a/gitmirror/robot.sh
+++ b/gitmirror/robot.sh
@@ -36,7 +36,7 @@ date=$(date -uR)
mkdir -m 0700 -p $tmpdir
- ( cd "$slave" && "$topdir"/filter-branches.pl ) > branches
+ ( cd "$slave" && "$topdir"/filter-branches.pl origin ) > branches
(
while read branch; do
GIT_DIR="$MASTER" git rev-parse --verify -q "$branch"'^{}' || true