dirstate: fix rebuild; add a test
If rebuild calls invalidate, it will just queue a (re)read of the dirstate
file, while what we really want is to empty the current state.
adding he
llo
abort: '\n' and '\r' disallowed in filenames
adding he
llo
abort: '\n' and '\r' disallowed in filenames
adding hell
o
abort: '\n' and '\r' disallowed in filenames
adding hell
o
abort: '\n' and '\r' disallowed in filenames
f he
llo he
llo
f hell
o hell
o