I have the same problem regularily, and I just went and hacked git find – if you don’t use the Debian package you can just copy the git-find script to /usr/lib/git-core/ (or comparable) and enjoy it.
It can be used in several modes, the easiest of which is indeed:
git find \*middleware\* # or git find '*middleware*' # which is short for git find -name '*middleware*'
Combining is also possible (and almost as flexible as regular find, you just have to write the -a explicitly):
git find \( -name \*.java -o -name \*.js \) -a ! -ipath \*/test/\*
It has a couple more options, most of which handle with filtering the name or full (partial, i.e. below the current working directory) path, some of them case-insensitively (-iname and friends), and two global options, one to toggle regexp between POSIX Basic (default) and POSIX Extended, the other toggles symlinks (default on); this finds only files (and symlinks), not directories or submodules (“gitlinks”) by design.
It can also pass the file list to regular find(1) if it’s not too long (it must be passed on the command line), which allows for things like…
git find -- -mtime -100
… at slight filesystem cost (find does access the filesystem), but on the other hand, almost all (not search depth-specific stuff) of find works, and you only get to operate on files “in the index”, i.e. known to git (present in the HEAD commit or git added).
It’s a bit picky about unresolved conflicts though. If you notice any problems with it, just drop me a note (here, or via IRC).
PS: Feel free to lobby the official git people to subtree-merge the git-find repository, I’d be more than happy to have it integrated into git proper (the licence is even more liberal, you just need the mksh shell in a somewhat recent (50 should be sufficient) version, but it’s the most widespread Unix shell nowadays so that’s okay).