diff --git a/features/clone.feature b/features/clone.feature index 73627b44930979ac95f89dfa4d0750b1a655460a..5c45aa48f283dc33bd00849d353a4a29a57d43ad 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 b612be91b7d7be6f8bdbd6b3da82376c10fca399..f26c8d47c1b2dba68ecfc58e251c5a508671ace3 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})$/