diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2019-12-06 17:49:18 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2019-12-06 17:49:18 -0700 |
commit | b2278ee9db7819f061740c8f38053db78575035f (patch) | |
tree | 6e6d175e91b8d3969b86407943dd6b5f00570907 /bin/git-branchmove | |
parent | 6db30e1f06a5e2ff0b48b192eac0725ab9c6ffca (diff) | |
download | dotfiles-b2278ee9db7819f061740c8f38053db78575035f.tar.gz |
fix $named_remote logic
Diffstat (limited to 'bin/git-branchmove')
-rwxr-xr-x | bin/git-branchmove | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/bin/git-branchmove b/bin/git-branchmove index a3f66b94..c9c0ff4d 100755 --- a/bin/git-branchmove +++ b/bin/git-branchmove @@ -88,8 +88,8 @@ my ($op, $remote, @patterns) = @ARGV; die "git-branchmove: unknown operation\n" unless $op eq 'get' or $op eq 'put'; -# is this a named remote or a git URL? -my $named_remote = $remote =~ m|:| or $remote =~ m|^[/.]|; +# is this a named remote or a git URL? See "GIT URLS" in git-fetch(1) +my $named_remote = not ($remote =~ m|:| or $remote =~ m|^[/.]|); # Attempt to determine how we might be able to run commands in the # remote repo. This will only be used if we need to try to detach the @@ -199,8 +199,7 @@ if ($op eq 'put') { # if the remote is a named remote, rather than just a URI, update # remote-tracking branches -# TODO if this really should be 'unless' not 'if', document it -unless ($named_remote) { +if ($named_remote) { foreach my $source_branch (@source_branches) { my $branch = $source_branch->{ref} =~ s|^refs/heads/||r; my $tracking_ref = "refs/remotes/$remote/$branch"; |