diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2019-12-06 17:54:05 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2019-12-06 17:54:05 -0700 |
commit | 075ee73b0300e5249c80581bc7db05302ca667f1 (patch) | |
tree | 7f1c7cd50c6a4cea05fac0202e50eff9787965c9 /bin/git-branchmove | |
parent | aecda1ceb33e4b727be349b7dbf2af687955c9a4 (diff) | |
download | dotfiles-075ee73b0300e5249c80581bc7db05302ca667f1.tar.gz |
fix remote detaching
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'); |