cleanup
parent
3923d2d74b
commit
c8d59d7e2d
|
|
@ -159,22 +159,16 @@ _bash-it-update-repo() {
|
||||||
local remote="${3:-origin}"
|
local remote="${3:-origin}"
|
||||||
local old_pwd="${PWD}"
|
local old_pwd="${PWD}"
|
||||||
|
|
||||||
if [[ ! -d "${dir}" ]] ; then
|
cd "${dir}" || return 1
|
||||||
|
|
||||||
return 1
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
cd "${dir}"
|
|
||||||
|
|
||||||
git fetch &> /dev/null
|
git fetch &> /dev/null
|
||||||
|
|
||||||
declare status
|
declare status
|
||||||
status="$(git rev-list master.."${remote}"/master 2> /dev/null)"
|
status="$(git rev-list master.."${remote}/master" 2> /dev/null)"
|
||||||
|
|
||||||
if [[ -n "${status}" ]]; then
|
if [[ -n "${status}" ]]; then
|
||||||
|
|
||||||
for i in $(git rev-list --merges --first-parent master.."${remote}"); do
|
for i in $(git rev-list --merges --first-parent "master..${remote}"); do
|
||||||
num_of_lines=$(git log -1 --format=%B "$i" | awk 'NF' | wc -l)
|
num_of_lines=$(git log -1 --format=%B "$i" | awk 'NF' | wc -l)
|
||||||
if [ "$num_of_lines" -eq 1 ]; then
|
if [ "$num_of_lines" -eq 1 ]; then
|
||||||
description="%s"
|
description="%s"
|
||||||
|
|
@ -184,7 +178,7 @@ _bash-it-update-repo() {
|
||||||
git --no-pager log --format="%h: $description (%an)" -1 "$i"
|
git --no-pager log --format="%h: $description (%an)" -1 "$i"
|
||||||
done
|
done
|
||||||
echo ""
|
echo ""
|
||||||
read -e -n 1 -p "Would you like to update to $(git log -1 --format=%h origin/master)? [Y/n] " RESP
|
read -e -n 1 -p "Would you like to update to $(git log -1 --format=%h "${remote}/master")? [Y/n] " RESP
|
||||||
|
|
||||||
case $RESP in
|
case $RESP in
|
||||||
[yY]|"")
|
[yY]|"")
|
||||||
|
|
@ -209,5 +203,4 @@ _bash-it-update-repo() {
|
||||||
|
|
||||||
cd "${old_pwd}" &> /dev/null || return 1
|
cd "${old_pwd}" &> /dev/null || return 1
|
||||||
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue