I think that the block is covering all cases. If the file doesn't exist the update flag is set and the file is in the index then the file is not added to the newly created index (this is the else if ).

I added a new test method testAddWithoutParameterUpdate and commented the existing one testAddWithParameterUpdate. They handle the six interesting cases. I do not test the case of "file exists neither in workdir nor inindex".