These if conditions seem too complicated to me. There should not be any way to get to this line and not have `error == GIT_ENOTFOUND`. Could the test just read `if (error != GIT_ENOTFOUND) return error;` and then proceed.