git checkout $CURRENT_BRANCH
git stash pop
-# not empty if there's at least one commit be merged
-TO_BE_MERGED=`git log --pretty=oneline --graph ..$UPSTREAM_BRANCH | head -n 1 | sed -n -e 's/\* //p'`
-TO_BE_MERGED=${TO_BE_MERGED%% *}
-
-echo "Last commit to be merged: "$TO_BE_MERGED
+TO_BE_MERGED=`git branch --merged | grep $UPSTREAM_BRANCH`
if [ "$TO_BE_MERGED" = "" ]; then
- echo -e "\nNot to be updated."
+ echo -e "\nThe debian branch must be updated."
else
- # the snapshot hash of the package
- SNAPSHOT_HASH=`head -n 1 debian/changelog | sed -n -e 's/.*\((.*)\).*/\1/;s/.*\(\.gbp\(.*\))\)/\2/p'`
-
- echo "Debian package snapshot version: "$SNAPSHOT_HASH
-
- if [ "${TO_BE_MERGED:6}" = "$SNAPSHOT_HASH" ]; then
- echo -e "\nNot to be updated."
- else
- echo -e "\nThe debian branch must be updated."
- fi
+ echo -e "\nNot to be updated."
fi