summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Debian/Dgit.pm8
-rwxr-xr-xdgit5
2 files changed, 8 insertions, 5 deletions
diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm
index b934774..211bae3 100644
--- a/Debian/Dgit.pm
+++ b/Debian/Dgit.pm
@@ -11,8 +11,8 @@ BEGIN {
$VERSION = 1.00;
@ISA = qw(Exporter);
- @EXPORT = qw(debiantag
- $package_re);
+ @EXPORT = qw(debiantag server_branch server_ref
+ $package_re $branchprefix);
%EXPORT_TAGS = ( policyflags => qw() );
@EXPORT_OK = qw();
}
@@ -20,6 +20,7 @@ BEGIN {
our @EXPORT_OK;
our $package_re = '[0-9a-z][-+.0-9a-z]*';
+our $branchprefix = 'dgit';
# policy hook exit status bits
@@ -39,4 +40,7 @@ sub debiantag ($) {
return "debian/$v";
}
+sub server_branch ($) { return "$branchprefix/$_[0]"; }
+sub server_ref ($) { return "refs/".server_branch($_[0]); }
+
1;
diff --git a/dgit b/dgit
index 0b5bf05..a0144bc 100755
--- a/dgit
+++ b/dgit
@@ -104,15 +104,14 @@ autoflush STDOUT 1;
our $remotename = 'dgit';
our @ourdscfield = qw(Dgit Vcs-Dgit-Master);
-our $branchprefix = 'dgit';
our $csuite;
our $instead_distro;
sub lbranch () { return "$branchprefix/$csuite"; }
my $lbranch_re = '^refs/heads/'.$branchprefix.'/([^/.]+)$';
sub lref () { return "refs/heads/".lbranch(); }
-sub lrref () { return "refs/remotes/$remotename/$branchprefix/$csuite"; }
-sub rrref () { return "refs/$branchprefix/$csuite"; }
+sub lrref () { return "refs/remotes/$remotename/".server_branch($csuite); }
+sub rrref () { return server_ref($csuite); }
sub stripepoch ($) {
my ($vsn) = @_;