I think I have nailed down why this bug happens. At "darcs add b",
invalidateIndex is called. When readIndex is called again, It rebuilds
the index. In the process, it calls readRecordedAndPending, which in
turn calls readPending. readPending calls applyToTree, with arguments
pending(a patch), pristine(a tree). In our case, pending had file "a"
removed, and thus it will also be removed from the rebuilded index!
invalidateIndex, readIndex, readRecordedAndPending, readPending all are
in Darcs.Repository.State
applyToTree is in Darcs.Patch.Apply
|