From 80edbc4dfce3e489ec1d76d82b7d6fe37b675271 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 5 Oct 2018 14:29:20 +0200 Subject: bin/harvest-commit-times: update repos on non-master before harvesting --- bin/harvest-commit-times | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'bin') diff --git a/bin/harvest-commit-times b/bin/harvest-commit-times index 163870f..fc876b8 100755 --- a/bin/harvest-commit-times +++ b/bin/harvest-commit-times @@ -58,6 +58,18 @@ if ! verbose_flock ${block_flag} 9; then exit fi +if ! ${i_am_the_master}; then + for repo_name in ${repo_names}; do + eval repo_path='"${repo_paths__'"${repo_name}"'}"' + if [ -d "${repo_path}/.git" ]; then + git -C "${repo_path}" remote update + else + git -C "${repo_path}" fetch origin master:master + fi || \ + true + done +fi + tmp_file=$(mktemp 'tmp.harvest-commit-times.XXXXXXXXXX' --tmpdir) trap 'rm "${tmp_file}"' EXIT -- cgit v1.2.3-70-g09d2