[client] Fix a bug of commit algorithm.

Should update index even nothing to commit.