Here you call this filepattern, but in AddCommand you call it filepath, and actually treat it as relative to the root of the working directory.

Similar to merge() I think add() should be just a factory which provides the command, and arguments should be set on the command.  Then we can have addFile(), and addPattern(), which have different behaviors as to how they setup the add request.  Further, we can add multiple things in one call, so that the DirCache only needs to be locked and written once, rather than per file specified in the user interface.