# HG changeset patch # User Stefan Engel # Date 1348600283 -7200 # Node ID 17556a81ec6f6a48a9283d55d4fb00f497b99bae # Parent b54d1024d9ea12d6ce05995d4c920677c7142ed7 Make detecting bare Git repositories more robust Git remote repositories may end on '.git', e.g. myrepo.git. Just checking for a repository path to end on '.git' causes 'Repository not found' errors in such a case. To distinguish between bare and normal Git repositories, check if there is a '/.git' part at the end of the repository path (i.e. if GIT_DIR is pointing to '.' (bare) or '.git'). diff -r b54d1024d9ea -r 17556a81ec6f rhodecode/lib/hooks.py --- a/rhodecode/lib/hooks.py Wed Sep 26 21:25:40 2012 +0200 +++ b/rhodecode/lib/hooks.py Tue Sep 25 21:11:23 2012 +0200 @@ -328,8 +328,8 @@ baseui = make_ui('db') # fix if it's not a bare repo - if repo_path.endswith('.git'): - repo_path = repo_path[:-4] + if repo_path.endswith(os.sep + '.git'): + repo_path = repo_path[:-5] repo = Repository.get_by_full_path(repo_path) if not repo: