<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -39,11 +39,18 @@ class GitManager
     return selected_remote
   end
 
+  def user_project_from_repo(repo)
+    if repo =~ %r{github\.com[:/]([^/]+)/(.+)\.git}
+      return {:user =&gt; $1, :project =&gt; $2}
+    end
+    return 
+  end
+  
   def github_url_for_project(github_remote=nil)
     github_remote ||= best_github_remote
     repo = repo_for_remote(github_remote)
-    if repo =~ %r{github\.com[:/]([^/]+)/([^.]+)\.git}
-      url_head($1, $2)
+    if user_project = user_project_from_repo(repo)
+      url_head(user_project)
     end
   end  
   
@@ -52,10 +59,10 @@ class GitManager
     branch ||= @git.current_branch
     repo = repo_for_remote(github_remote)
     path = file.gsub(working_path, '').gsub(%r{\A/},'')
-    if repo =~ %r{github\.com[:/]([^/]+)/([^.]+)\.git}
+    if user_project = user_project_from_repo(repo)
       user, project = $1, $2
       response = nil
-      url_head(user, project, branch) + &quot;/#{path}&quot;
+      url_head(user_project, branch) + &quot;/#{path}&quot;
     end
   end
   
@@ -98,7 +105,8 @@ class GitManager
     path_bits = path.split('/') # =&gt; [&quot;&quot;, &quot;Users&quot;, &quot;drnic&quot;, &quot;Documents&quot;, &quot;ruby&quot;, &quot;gems&quot;, &quot;newgem&quot;, &quot;bin&quot;]
     @git = nil
     while !@git &amp;&amp; path_bits.length &gt; 1
-      path_bits.pop unless (@git = Git.open(path_bits.join('/')) rescue nil)
+      path = path_bits.join('/')
+      path_bits.pop unless (@git = Git.open(path) rescue nil)
     end
     raise NotGitRepositoryError unless @git
   end
@@ -107,9 +115,9 @@ class GitManager
     config[&quot;remote.#{remote}.url&quot;]
   end
   
-  def url_head(user, project, branch='')
+  def url_head(user_project, branch='')
     branch = &quot;tree/#{branch}&quot; if branch != ''
-    project_path = &quot;/#{user}/#{project}/#{branch}&quot;
+    project_path = &quot;/#{user_project[:user]}/#{user_project[:project]}/#{branch}&quot;
     project_private?(project_path) ? 
       &quot;https://github.com#{project_path}&quot; : &quot;http://github.com#{project_path}&quot;
   end</diff>
      <filename>Support/lib/git_manager.rb</filename>
    </modified>
    <modified>
      <diff>@@ -21,4 +21,14 @@ class TestGitManager &lt; Test::Unit::TestCase
     expected = %w[origin]
     assert_equal(expected, @git.github_remotes)
   end
+  
+  def test_github_pages_account_remote_urls_can_be_parsed
+    @git.stubs(:config).returns({
+      &quot;user.name&quot;=&gt;&quot;Dr Nic Williams&quot;, &quot;user.email&quot;=&gt;&quot;drnicwilliams@gmail.com&quot;, 
+      &quot;remote.origin.url&quot;=&gt;&quot;git@github.com:railscampau/railscampau.github.com.git&quot;, 
+      &quot;remote.origin.fetch&quot;=&gt;&quot;refs/heads/*:refs/remotes/origin/*&quot;
+    })
+    expected = &quot;http://github.com/railscampau/railscampau.github.com/&quot;
+    assert_equal(expected, @git.github_url_for_project)
+  end
 end
\ No newline at end of file</diff>
      <filename>Support/test/test_git_manager.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>05a926cca5e39b9c728ce943c958cdeafce19aac</id>
    </parent>
  </parents>
  <author>
    <name>Dr Nic Williams</name>
    <email>drnicwilliams@gmail.com</email>
  </author>
  <url>http://github.com/drnic/github-tmbundle/commit/30c8bc1044a602843246313df15e0fded5a7cc44</url>
  <id>30c8bc1044a602843246313df15e0fded5a7cc44</id>
  <committed-date>2009-03-24T18:57:25-07:00</committed-date>
  <authored-date>2009-03-24T18:57:25-07:00</authored-date>
  <message>fixed for github projects for github pages (github.com/username/projectname.github.com)</message>
  <tree>5a03ba8c03501476c660d993d831c48d285da011</tree>
  <committer>
    <name>Dr Nic Williams</name>
    <email>drnicwilliams@gmail.com</email>
  </committer>
</commit>
