Changeset - 3d0bd5f71dab
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2012-09-06 17:54:08
marcin@python-works.com
raise na OSERROR if repository data sent from git hook to hook handler is somehow invalid
1 file changed with 7 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/hooks.py
Show inline comments
 
@@ -34,10 +34,9 @@ from rhodecode.lib import helpers as h
 
from rhodecode.lib.utils import action_logger
 
from rhodecode.lib.vcs.backends.base import EmptyChangeset
 
from rhodecode.lib.compat import json
 
from rhodecode.model.db import Repository, User
 
from rhodecode.lib.exceptions import HTTPLockedRC
 
from rhodecode.lib.utils2 import safe_str
 
from rhodecode.lib.exceptions import HTTPLockedRC
 

	
 
from rhodecode.model.db import Repository, User
 

	
 
def _get_scm_size(alias, root_path):
 

	
 
@@ -330,7 +329,12 @@ def handle_git_receive(repo_path, revs, 
 
    # fix if it's not a bare repo
 
    if repo_path.endswith('.git'):
 
        repo_path = repo_path[:-4]
 

	
 
    repo = Repository.get_by_full_path(repo_path)
 
    if not repo:
 
        raise OSError('Repository %s not found in database'
 
                      % (safe_str(repo_path)))
 

	
 
    _hooks = dict(baseui.configitems('hooks')) or {}
 

	
 
    extras = json.loads(env['RHODECODE_EXTRAS'])
0 comments (0 inline, 0 general)