use different method to set default value for GIT_PREVIOUS_COMMIT

The previous way seems to have been broken.
Still not sure why, unless bash considers an empty string as not empty.

Signed-off-by: Dave Simons <dave@inuits.eu>