diff hggit/git_handler.py @ 447:1189e52ba27c

Strip trailing slash for heroku-style URLs. Fixes #31. Includes a regression test for the fix.
author Jason R. Coombs <jaraco@jaraco.com>
date Fri, 27 Jan 2012 22:48:55 -0500
parents 7e6fc0efc500
children e58a6d0b80e2
line wrap: on
line diff
--- a/hggit/git_handler.py	Fri Jan 27 13:24:31 2012 -0500
+++ b/hggit/git_handler.py	Fri Jan 27 22:48:55 2012 -0500
@@ -1110,6 +1110,10 @@
             host, port, sepr, path = res['host'], res['port'], res['sepr'], res['path']
             if sepr == '/':
                 path = '/' + path
+            # strip trailing slash for heroku-style URLs
+            # ssh+git://git@heroku.com:project.git/
+            if sepr == ':' and path.endswith('.git/'):
+                path = path.rstrip('/')
             if port:
                 client.port = port