Update, repo tool cloner: recursive clones
Signed-off-by: Václav Valíček <valicek1994@gmail.com>
This commit is contained in:
@@ -13,38 +13,12 @@ IFS=$'\n\t'
|
||||
|
||||
source $(dirname $(realpath $0))/gen-mirror-path
|
||||
|
||||
|
||||
function updateOrCreate(){
|
||||
url=$1
|
||||
repodir=$(getRepoPath $url)
|
||||
|
||||
if [ ! -d $repodir ]
|
||||
then
|
||||
echo "Clone of $url"
|
||||
git clone --bare --mirror $url $repodir
|
||||
# create FETCH_HEAD needed by other scripts
|
||||
cd $repodir
|
||||
git fetch --prune
|
||||
else
|
||||
cd $repodir
|
||||
echo "Update of $url"
|
||||
git fetch --prune
|
||||
fi
|
||||
# implemented in RepoTool
|
||||
}
|
||||
|
||||
function getLastCommit(){
|
||||
url=$1
|
||||
repodir=$(getRepoPath $url)
|
||||
if [ -d $repodir ]
|
||||
then
|
||||
cd $repodir
|
||||
git --no-pager log --full-history --all -1 --pretty=format:"%H%n"
|
||||
else
|
||||
echo '-'
|
||||
fi
|
||||
|
||||
# replaced by git_tool repo hash
|
||||
}
|
||||
|
||||
oldPwd=$(pwd)
|
||||
updateOrCreate $1
|
||||
cd $oldPwd
|
||||
updateOrCreate $1
|
||||
Reference in New Issue
Block a user