Fix commit lookup if tag passed

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>