mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 12:38:20 +00:00
Add helpers for syncing commit files with external testsuites
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.
This commit is contained in:
parent
9f3dfbdb13
commit
bf9b1ebbbe
5 changed files with 72 additions and 3 deletions
23
testing/external/scripts/sync-repo
vendored
Executable file
23
testing/external/scripts/sync-repo
vendored
Executable file
|
@ -0,0 +1,23 @@
|
|||
#! /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
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue