Checking when PREV_COMMIT is empty

This commit is contained in:
Sergio Durigan Junior 2016-11-10 17:12:02 -05:00
parent 14d1488dab
commit cdc3f5ad32

View file

@ -111,7 +111,7 @@ find . -type f ! -name "*.xz" | xargs xz --verbose --compress
PREV_COMMIT=`sqlite3 $DB_NAME "SELECT commitid FROM logs WHERE branch = '$BRANCH' AND trysched = 0 ORDER BY timestamp DESC LIMIT 1"` PREV_COMMIT=`sqlite3 $DB_NAME "SELECT commitid FROM logs WHERE branch = '$BRANCH' AND trysched = 0 ORDER BY timestamp DESC LIMIT 1"`
if test "$IS_TRY_SCHED" != "yes" ; then if test -n "$PREV_COMMIT" -a "$IS_TRY_SCHED" = "no" ; then
PREV_2DIG=`echo $PREV_COMMIT | sed 's/^\(..\).*$/\1/'` PREV_2DIG=`echo $PREV_COMMIT | sed 's/^\(..\).*$/\1/'`
ln -s $DIR/$PREV_2DIG/$PREV_COMMIT PREVIOUS_COMMIT ln -s $DIR/$PREV_2DIG/$PREV_COMMIT PREVIOUS_COMMIT
ln -s $DIR/$CDIR $DIR/$PREV_2DIG/$PREV_COMMIT/NEXT_COMMIT ln -s $DIR/$CDIR $DIR/$PREV_2DIG/$PREV_COMMIT/NEXT_COMMIT