38 lines
665 B
Plaintext
38 lines
665 B
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
|
||
|
function detectorSum(){
|
||
|
local dir=$1
|
||
|
[ -f $dir/FETCH_HEAD ] || touch $dir/FETCH_HEAD
|
||
|
# use md5sum - it is in busybox
|
||
|
cat $dir/FETCH_HEAD | md5sum | cut -f1 -d' '
|
||
|
}
|
||
|
|
||
|
function detectorSumPersist(){
|
||
|
detectorSum $1 > $CCLONE_CACHE/detectorSum
|
||
|
}
|
||
|
|
||
|
function detectorCheckFetchHead(){
|
||
|
# check if repo fetch_head changed, if so, return 1
|
||
|
local dir=$1
|
||
|
|
||
|
[ -f $CCLONE_CACHE/detectorSum ] || touch $CCLONE_CACHE/detectorSum
|
||
|
|
||
|
newSum=$(detectorSum $dir)
|
||
|
oldSum=$(cat $CCLONE_CACHE/detectorSum)
|
||
|
|
||
|
if [ "x$oldSum" = "x$newSum" ]
|
||
|
then
|
||
|
return 0
|
||
|
else
|
||
|
return 1
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
|
||
|
function gitListTags(){
|
||
|
local dir=$1
|
||
|
git --no-paginate --git-dir="$dir" tag -l
|
||
|
|
||
|
}
|