require

Call this function when an error code is returned from a git function. It will retrieve the last error and throw a GitException.

Note: assert or in blocks should be used to verify arguments (such as strings) before calling Git functions since Git itself does not check pointers for null. Passing null pointers to Git functions usually results in access violations.

package
void
require
(
bool state
,
Exception next = null
,
string file = __FILE__
,
size_t line = __LINE__
)

Examples

import deimos.git2.oid;
git_oid oid;
assertThrown!GitException(require(git_oid_fromstr(&oid, "foobar") == 0));

Meta