+OLDDIR="$(pwd)";
+cd "$SACONFIG";
+git fetch --quiet --all >/dev/null 2>&1 || exit 0;
+REMOTE_BRANCH="$(git status --porcelain --branch|grep '^##'|sed 's/.*\.\.\.//;s/ \[.*$//;')";
+CURRENT_HEAD="$(git rev-parse HEAD)"
+REMOTE_BRANCH_HEAD="$(git rev-parse "$REMOTE_BRANCH")"
+cd "$OLDDIR";
+## there aren't any updates, stop here.
+if [ "$REMOTE_BRANCH_HEAD" = "$CURRENT_HEAD" ]; then
+ remove_pidfile;
+ exit 0;
+fi;
+trap remove_pidfile 0;