fixed GetLastCommit with branches