Reflog message can be null

Signed-off-by: Sup Yut Sum <ch3cooli@gmail.com>
Fix includes

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Fixed issue #1648: Issue with handles being kept when there are uncommitted changes

Signed-off-by: Sven Strickroth <email@cs-ware.de>