my $make = $Config{make};
my $null = File::Spec->devnull;
-system("git fetch");
-if (system("git rev-parse --quiet --verify v$version >$null") == 0) {
- die "Tag v$version already exists!";
-}
-
chomp(my $head = `git symbolic-ref -q HEAD`);
(my $current_branch = $head) =~ s{^refs/heads/}{};
$head eq "refs/heads/$branch"
chomp(my $upstream = `git for-each-ref --format="%(upstream)" $head`);
length $upstream
or die "No upstream branch configured for $branch!\n";
+
+my (undef, undef, $remote) = split qr{/}, $upstream;
+
+my $push_url = `git remote get-url --push $remote`;
+chomp $push_url;
+
+system(qq[git -c remote.$remote.url="$push_url" fetch]) == 0
+ or exit 1;
+
+if (system("git rev-parse --quiet --verify v$version >$null") == 0) {
+ die "Tag v$version already exists!";
+}
+
my $base_rev = `git merge-base $upstream $head`;
my $upstream_rev = `git rev-parse --verify $upstream`;
$upstream_rev eq $base_rev