gitweb: do not change working directory inside actions script

This is a good practice and maybe related to commit 83337e47

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Veiko Aasa 2019-10-28 19:13:01 +03:00 committed by Sunil Mohan Adapa
parent ba9869c030
commit caa336babc
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

View File

@ -211,11 +211,12 @@ def subcommand_repo_info(arguments):
def subcommand_create_repo(arguments):
"""Create a new git repository."""
validate_repository(arguments.name)
os.chdir(GIT_REPO_PATH)
repo_name = arguments.name + '.git'
subprocess.check_call(['git', 'init', '--bare', repo_name])
subprocess.check_call(['git', 'init', '--bare', repo_name],
cwd=GIT_REPO_PATH)
if not arguments.keep_ownership:
subprocess.check_call(['chown', '-R', 'www-data:www-data', repo_name])
subprocess.check_call(['chown', '-R', 'www-data:www-data', repo_name],
cwd=GIT_REPO_PATH)
_set_repo_description(arguments.name, arguments.description)
_set_repo_owner(arguments.name, arguments.owner)
if arguments.is_private: