From 65c4d6674a0543d6de1f5dbffdb12615ef61ffbb Mon Sep 17 00:00:00 2001 From: Ethan Zhuang Date: Mon, 25 Jun 2012 14:15:55 +0800 Subject: [PATCH] support repos whose name starts with a period --- features/clone.feature | 6 ++++++ lib/hub/commands.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/features/clone.feature b/features/clone.feature index 73627b44..5c45aa48 100644 --- a/features/clone.feature +++ b/features/clone.feature @@ -9,6 +9,11 @@ Feature: hub clone Then it should clone "git://github.com/hookio/hook.js.git" And there should be no output + Scenario: Clone a public repo that starts with a period + When I successfully run `hub clone zhuangya/.vim` + Then it should clone "git://github.com/zhuangya/.vim.git" + And there should be no output + Scenario: Clone a public repo with HTTPS Given HTTPS is preferred When I successfully run `hub clone rtomayko/ronn` @@ -89,3 +94,4 @@ Feature: hub clone When I successfully run `hub clone dotfiles` Then the git command should be unchanged And there should be no output + diff --git a/lib/hub/commands.rb b/lib/hub/commands.rb index b612be91..f26c8d47 100644 --- a/lib/hub/commands.rb +++ b/lib/hub/commands.rb @@ -34,7 +34,7 @@ module Hub # provides git interrogation methods extend Context - NAME_RE = /\w[\w.-]*/ + NAME_RE = /[\w.][\w.-]*/ OWNER_RE = /[a-zA-Z0-9-]+/ NAME_WITH_OWNER_RE = /^(?:#{NAME_RE}|#{OWNER_RE}\/#{NAME_RE})$/ -- GitLab