split /\,/, access_cfg('dgit-tag-format');
}
+sub need_tagformat ($$) {
+ my ($fmt, $why) = @_;
+ fail "need to use tag format $fmt ($why) but also need".
+ " to use tag format $tagformat_want->[0] ($tagformat_want->[1])".
+ " - no way to proceed"
+ if $tagformat_want && $tagformat_want->[0] ne $fmt;
+ $tagformat_want = [$fmt, $why, $tagformat_want->[2] // 0];
+}
+
sub select_tagformat () {
# sets $tagformatfn
return if $tagformatfn && !$tagformat_want;
sub rpush_handle_protovsn_bothends () {
if ($protovsn < 4) {
- fail "rpush negotiated protocol version $protovsn".
- " which supports old tag format only".
- " but trying to use new format (".$tagformat_want->[1].")"
- if $tagformat_want && $tagformat_want->[0] ne 'old';
- $tagformat_want = ['old', "rpush negotiated protocol $protovsn", 0];
+ need_tagformat 'old', "rpush negotiated protocol $protovsn";
}
select_tagformat();
}