`GIT_ASSERT` may be a macro for `assert` (when `GIT_ASSERT_HARD` is defined), which may differ in debug builds. Pull the assignment out of the assertion.