Patch Set 4:

(Sorry for the triple commit) 

I've extended the test coverage as required.

If the tests are failing, it is probably because they are unable to create a .git/info/exclude file. I used a hack to generate the file on the fly because I can't commit excludeTest/.git/info/exclude to the repository. It's also useful for other testing. 

The current patch should correctly delete any extra files/folders created for testing purposes.

Please let me know if there is anything else I need to change :)