File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -1094,7 +1094,7 @@ update_cache() {
10941094# To upgrade tool with git
10951095# by maintaining a local cache
10961096_upgrade () {
1097-
1097+ TITLE " upgrade() "
10981098 local branch=" "
10991099
11001100 while [ $# -gt 0 ]; do
@@ -1129,6 +1129,17 @@ _upgrade() {
11291129 LOG " upgrade(): switching to branch $branch "
11301130 git -C $repo_cache checkout $branch
11311131 fi
1132+
1133+ new_commits=$( git -C $repo_cache --no-pager log --oneline HEAD..origin)
1134+ if [[ -z $new_commits ]]; then
1135+ LOG " upgrade(): already in the lastest version, no need to upgrade"
1136+ DIE " Already up to date!"
1137+ fi
1138+
1139+ echo " ---- new commits ----"
1140+ git -C $repo_cache --no-pager log --oneline HEAD..origin # $new_commits is not formatted
1141+ echo -e " ---------------------\n"
1142+ sleep .5
11321143
11331144 # pull latest changes, if conflict occurs, clean and pull again
11341145 git -C $repo_cache pull || {
@@ -1137,11 +1148,6 @@ _upgrade() {
11371148 git -C $repo_cache pull
11381149 }
11391150
1140- echo " ----"
1141- git --no-pager log --oneline HEAD..origin
1142- echo -e " ----\n"
1143- sleep 1
1144-
11451151 # change to repo directory and install it
11461152 cd $repo_cache || {
11471153 ELOG " upgrade(): failed to change to $repo_cache "
You can’t perform that action at this time.
0 commit comments