mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00

This provides "make sync-repos" to check out all locally available testsuites at the commits indicated in their commit files, and "make sync-commits" to update the commit files to the HEADs of the local testsuite repos. Also adds the commit -> repo sync for the Makefile init target so initialization always lands on the right version, and removes the corresponding explicit checkout from the CI repo setup.
23 lines
585 B
Bash
Executable file
23 lines
585 B
Bash
Executable file
#! /usr/bin/env bash
|
|
#
|
|
# This moves the requested test repo to the commit indicated in its commit file.
|
|
# If repo or commit file do not exist, it does nothing.
|
|
[[ -z "$1" ]] && {
|
|
echo "sync-repo needs a local testsuite repository path as argument"
|
|
exit 1
|
|
}
|
|
|
|
repo="$1"
|
|
reponame=$(basename $repo)
|
|
commitfile=commit-hash.$reponame
|
|
|
|
[[ ! -d $repo || ! -f $commitfile ]] && exit 0
|
|
|
|
commit=$(cat $commitfile)
|
|
|
|
[[ $commit == $(cd $repo && git rev-parse HEAD) ]] && exit 0
|
|
|
|
(
|
|
echo "Moving '$reponame' to $commit"
|
|
cd $repo && git -c advice.detachedHead=false checkout $commit
|
|
)
|