Created
August 12, 2014 02:02
-
-
Save masaki/d9f453b04ef07791eca9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/App/cpanminus/script.pm b/lib/App/cpanminus/script.pm | |
index 2d0a845..56c1aa3 100644 | |
--- a/lib/App/cpanminus/script.pm | |
+++ b/lib/App/cpanminus/script.pm | |
@@ -1747,7 +1747,7 @@ sub resolve_name { | |
# Git | |
if ($module =~ /(?:^git(?:\+\w+)?:|\.git(?:@.+)?$)/) { | |
- return $self->git_uri($module); | |
+ return $self->git_uri($module, $version); | |
} | |
# URL | |
@@ -1828,7 +1828,7 @@ sub cpan_dist { | |
} | |
sub git_uri { | |
- my ($self, $uri) = @_; | |
+ my ($self, $uri, $version) = @_; | |
# similar to http://www.pip-installer.org/en/latest/logic.html#vcs-support | |
# git URL has to end with .git when you need to use pin @ commit/tag/branch | |
@@ -1866,14 +1866,16 @@ sub git_uri { | |
chomp($rev = `git rev-parse --short HEAD`); | |
} | |
+ $version ||= 0; | |
+ | |
$self->diag_ok; | |
return { | |
source => 'git', | |
dist => $name, | |
- version => $rev, | |
+ version => $version, | |
revision => $rev, | |
- distvname => "$name-$rev", | |
+ distvname => "$name-$version", | |
uri => $uri, | |
ref => $commitish, | |
dir => $dir, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment