##// END OF EJS Templates
added missing installation of git hooks when doing a fork
marcink -
r2991:578a152f beta
parent child Browse files
Show More
@@ -50,6 +50,7 b' from rhodecode.lib.compat import json, O'
50 from rhodecode.lib.hooks import log_create_repository
50 from rhodecode.lib.hooks import log_create_repository
51
51
52 from rhodecode.model.db import Statistics, Repository, User
52 from rhodecode.model.db import Statistics, Repository, User
53 from rhodecode.model.scm import ScmModel
53
54
54
55
55 add_cache(config)
56 add_cache(config)
@@ -402,17 +403,19 b' def create_repo_fork(form_data, cur_user'
402 backend = get_backend(repo_type)
403 backend = get_backend(repo_type)
403
404
404 if repo_type == 'git':
405 if repo_type == 'git':
405 backend(safe_str(destination_fork_path), create=True,
406 r = backend(safe_str(destination_fork_path), create=True,
406 src_url=safe_str(source_repo_path),
407 src_url=safe_str(source_repo_path),
407 update_after_clone=update_after_clone,
408 update_after_clone=update_after_clone,
408 bare=True)
409 bare=True)
409 elif repo_type == 'hg':
410 elif repo_type == 'hg':
410 backend(safe_str(destination_fork_path), create=True,
411 r = backend(safe_str(destination_fork_path), create=True,
411 src_url=safe_str(source_repo_path),
412 src_url=safe_str(source_repo_path),
412 update_after_clone=update_after_clone)
413 update_after_clone=update_after_clone)
413 else:
414 else:
414 raise Exception('Unknown backend type %s' % repo_type)
415 raise Exception('Unknown backend type %s' % repo_type)
415
416
417 # add rhodecode hook into this repo
418 ScmModel().install_git_hook(repo=r)
416 log_create_repository(fork_repo.get_dict(), created_by=cur_user.username)
419 log_create_repository(fork_repo.get_dict(), created_by=cur_user.username)
417
420
418 action_logger(cur_user, 'user_forked_repo:%s' % fork_name,
421 action_logger(cur_user, 'user_forked_repo:%s' % fork_name,
General Comments 0
You need to be logged in to leave comments. Login now