Add: mod_ssh pull latest branch in sync
This commit is contained in:
parent
e67ebebcb0
commit
eb51c1e485
@ -351,6 +351,9 @@ idm_git__repo_sync ()
|
|||||||
# If i well undertood, never do a push !
|
# If i well undertood, never do a push !
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# update local worktree
|
||||||
|
idm_git_pull_most_recent $id
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -495,6 +498,26 @@ idm_git__perm_restore ()
|
|||||||
## Internal lib
|
## Internal lib
|
||||||
##############################
|
##############################
|
||||||
|
|
||||||
|
idm_git_pull_most_recent ()
|
||||||
|
{
|
||||||
|
local id=${1}
|
||||||
|
|
||||||
|
most_recent=$(lib_git git branch -a --sort=-committerdate | sed 's/..//' | head -n 1 )
|
||||||
|
|
||||||
|
# Check if we are fine
|
||||||
|
if [[ ! "$most_recent" =~ ^remote ]] ; then
|
||||||
|
lib_log NOTICE "Already up to date"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Apply changes to most recent branch
|
||||||
|
branch=$( sed -e 's@remotes/@@' -e 's@/@ @' )
|
||||||
|
lib_git git pull $branch ||
|
||||||
|
lib_log ERR "Could not update branch"
|
||||||
|
|
||||||
|
lib_log NOTICE "Repo updated"
|
||||||
|
}
|
||||||
|
|
||||||
idm_git_get_files_of_interest ()
|
idm_git_get_files_of_interest ()
|
||||||
{
|
{
|
||||||
local id=${1}
|
local id=${1}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user