diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-05-04 14:00:11 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-05-04 15:28:25 +0200 |
commit | 395ac136ff2c40a5a443844a10e818adffe54f34 (patch) | |
tree | 96f1f1706a5210ce9666f22ecb0cc22a33562533 /bin | |
parent | 38c479d05ca15667f8fc2486a3b7df1cc3b8b430 (diff) |
simplify ref extraction regexes
Change-Id: I0dde8c53c104e3edb7ce7b47c5abfcd171dfdfbe
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/git-gpush | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/git-gpush b/bin/git-gpush index b4b0d41..b1bb6ff 100755 --- a/bin/git-gpush +++ b/bin/git-gpush @@ -184,12 +184,12 @@ sub push_patches if ($self->{'ref-to'} eq "") { my $ref = `git symbolic-ref -q $self->{'ref-from'}`; die "Detached HEAD mode. I won't know where to push to.\n" if ($? != 0); - $ref =~ s,refs/heads/(\S+).*,$1,; chomp $ref; + $ref =~ s,^refs/heads/,,; my $trackref = `git config branch.$ref.merge`; die "Cannot detect tracking branch, 'git config branch.$ref.merge' failed.\n" if ($? != 0); - $trackref =~ s,refs/heads/(\S+).*,$1,; chomp $trackref; + $trackref =~ s,^refs/heads/,,; $self->{'ref-to'} = "refs/for/$trackref"; } |