diff --git a/scripts/gitadmin/rebuild_gitadmin.php b/scripts/gitadmin/rebuild_gitadmin.php index 38a194183d..840e4dcc69 100755 --- a/scripts/gitadmin/rebuild_gitadmin.php +++ b/scripts/gitadmin/rebuild_gitadmin.php @@ -98,7 +98,7 @@ function handleSingleRepository( $values = array(); $values['members'] = join(' ', $members); $values['readonly'] = '@all'; - $values['writable'] = $repository->getName(); + $values['writable'] = strtolower($repository->getName()); $new_configuration["group $group_name"] = $values; } } @@ -189,11 +189,11 @@ function runGitSshCommand($repository, $key, $need_workdir, $arguments, return $return_var == 0; } -function repositoryPull($repository) { - return runGitCommand($repository, false, 'pull'); +function repositoryPull($repository, $key) { + return runGitSshCommand($repository, $key, false, 'pull'); } -function repositoryCommitAll($repository, $message) { +function repositoryCommitAll($repository, $author, $message) { if (!runGitCommand( $repository, true, 'ls-files --other --exclude-standard', $untracked_files)) { @@ -208,7 +208,8 @@ function repositoryCommitAll($repository, $message) { runGitCommand($repository, true, "update-index -q --refresh", $output); runGitCommand($repository, true, "diff-index --name-only HEAD --", $output); if (count($output)) { - return runGitCommand($repository, true, "commit -a -m '$message'", $output); + return runGitCommand( + $repository, true, "commit --author='$author' -a -m '$message'", $output); } return true; } @@ -221,7 +222,7 @@ if (count($argv) != 3) { $gitosis_root = $argv[1]; $key = $argv[2]; -if (!repositoryPull($gitosis_root)) { +if (!repositoryPull($gitosis_root, $key)) { print("Failed to pull changes from server.\n"); exit(1); } @@ -230,10 +231,12 @@ if (!rebuildConfiguration($gitosis_root)) { exit(1); } -if (!repositoryCommitAll($gitosis_root, 'Update to correspond changes in Phabricator')) { +if (!repositoryCommitAll( + $gitosis_root, 'Rebuild Gitadmin ', + 'Update to correspond changes in Phabricator')) { print("Failed to commit changes.\n"); exit(1); } -runGitSshCommand($gitosis_root, $key, true, 'push'); +runGitSshCommand($gitosis_root, $key, true, 'push origin master'); ?>