Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Unified Diff: utils/pub/git_source.dart

Issue 10875056: Properly handle Git URLs with trailing slashes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | utils/pub/pubspec.dart » ('j') | utils/tests/pub/pub_install_git_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/git_source.dart
diff --git a/utils/pub/git_source.dart b/utils/pub/git_source.dart
index 7f59d8941e9a15b578e2cd6bc6d9fd3ba9cda2ba..a815feb2c7638dc47abaaf70223c5cb4524fb957 100644
--- a/utils/pub/git_source.dart
+++ b/utils/pub/git_source.dart
@@ -64,8 +64,10 @@ class GitSource extends Source {
* The package name of a Git repo is the name of the directory into which
* it'll be cloned.
*/
- String packageName(description) =>
- basename(_getUrl(description)).replaceFirst(const RegExp("\.git\$"), "");
+ String packageName(description) {
+ return basename(_getUrl(description)
+ .replaceFirst(const RegExp(@"(\.git)?/?$"), ""));
+ }
/**
* Ensures [description] is a Git URL.
« no previous file with comments | « no previous file | utils/pub/pubspec.dart » ('j') | utils/tests/pub/pub_install_git_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698