Fix assertion / 0000000 is used if revision is reference instead of hash

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