Fixed issue #1977: Commit log: cannot select multiple branches if a branch name matches a filename

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