fix guessing patch level for git diff patches by not stripping off b/ prefix

* fix guessing patch level for git diff patches by not stripping off b/ prefix
* refactor to create guess_patch_level function
* enhance unit tests