Refactor main function in git_deploy module.