File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -222,19 +222,34 @@ _bash-it_update-() {
222222 TARGET=${BASH_IT_REMOTE} /${BASH_IT_DEVELOPMENT_BRANCH}
223223 fi
224224
225+ declare revision
226+ revision=" HEAD..${TARGET} "
225227 declare status
226- status=" $( git rev-list HEAD.." ${TARGET} " 2> /dev/null) "
228+ status=" $( git rev-list ${revision} 2> /dev/null) "
229+ declare revert
230+
231+ if [[ -z " ${status} " && ${version} == " stable" ]]; then
232+ revision=" ${TARGET} ..HEAD"
233+ status=" $( git rev-list ${revision} 2> /dev/null) "
234+ revert=true
235+ fi
227236
228237 if [[ -n " ${status} " ]]; then
238+ if [[ $revert ]]; then
239+ echo " Your version is a more recent development version ($( git log -1 --format=%h HEAD) )"
240+ echo " You can continue in order to revert and update to the latest stable version"
241+ echo " "
242+ log_color=" %Cred"
243+ fi
229244
230- for i in $( git rev-list --merges --first-parent HEAD.. " ${TARGET} " ) ; do
245+ for i in $( git rev-list --merges --first-parent ${revision} ) ; do
231246 num_of_lines=$( git log -1 --format=%B $i | awk ' NF' | wc -l)
232247 if [ $num_of_lines -eq 1 ]; then
233248 description=" %s"
234249 else
235250 description=" %b"
236251 fi
237- git log --format=" %h: $description (%an)" -1 $i
252+ git log --format=" ${log_color} %h: $description (%an)" -1 $i
238253 done
239254 echo " "
240255
You can’t perform that action at this time.
0 commit comments