gitrefresh

Easily export, reinitialize and update all git repositories in a file hierarchy
git clone git://git.defalsify.org/gitrefresh.git
Log | Files | Refs | README | LICENSE

commit e82bf5eb478e915fbc6a480c3749bd1ecac1724e
parent b50579b13457467b9cfa16bfdb4de06512491506
Author: lash <dev@holbrook.no>
Date:   Sun,  9 Jan 2022 15:26:52 +0000

Add git list test

Diffstat:
Atests/test_list.sh | 36++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+), 0 deletions(-)

diff --git a/tests/test_list.sh b/tests/test_list.sh @@ -0,0 +1,36 @@ +wd=$(pwd) + +if [ ! -f ./gitrefresh.sh ]; then + >&2 echo please run from code repository root + exit 1; +fi + +ts=$(mktemp -d) +td=$(mktemp -d) +r=$(mktemp) +pushd $ts + +ds=(a b c) +for d in ${ds[@]}; do + mkdir -v $d + pushd $d + git init + uuidgen > data.txt + git add data.txt + git commit -m "initial commit" + popd + pushd $td + repo="file://$ts/$d" + echo $repo >> $r + git clone $repo + popd +done +popd + +vr=$(mktemp) +vl=$(mktemp) +sort $r > $vr + +bash ./gitlist.sh $td | sort > $vl + +diff $vr $vl