diff options
Diffstat (limited to 'bin/git-branchmove')
-rwxr-xr-x | bin/git-branchmove | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/git-branchmove b/bin/git-branchmove index f72ca4bf..4b1d6b55 100755 --- a/bin/git-branchmove +++ b/bin/git-branchmove @@ -98,11 +98,11 @@ my $named_remote = not ($remote =~ m|:| or $remote =~ m|^[/.]|); my ($rurl, $rrune, $rdir); if ($named_remote) { # this will expand insteadOf and pushInsteadOf - $rurl = `git remote get-url --push $remote`; + ($rurl) = $git->remote("get-url", "--push", $remote); } else { # this will expand insteadOf but not pushInsteadOf, which is the # best we can do; see <https://stackoverflow.com/a/32991784> - $rurl = `git ls-remote --get-url $remote`; + ($rurl) = $git->ls_remote("--get-url", $remote); } if ($rurl =~ m#^ssh://([^:/]+)(?:\:(\w+))?#) { $rdir = $'; @@ -160,8 +160,8 @@ if (defined $source_head and grep /^\Q$source_head\E$/, $git->checkout('--detach'); } elsif ($op eq 'get') { if (defined $rrune and defined $rdir) { - system "$rrune \"set -e; cd $rdir; git checkout --detach\"" - or die "failed to detach remote HEAD"; + system "$rrune \"set -e; cd $rdir; git checkout --detach\""; + die "failed to detach remote HEAD" unless $? eq 0; } elsif (!defined $rrune and defined $rdir) { my $dest_git = Git::Wrapper->new($rdir); $dest_git->checkout('--detach'); |