git_oid_fromstr

Parse a hex formatted object id into a git_oid.

The appropriate number of bytes for the given object ID type will be read from the string - 40 bytes for SHA1, 64 bytes for SHA256. The given string need not be null terminated.

  1. int git_oid_fromstr(.git_oid* out_, const(char)* str, .git_oid_t type)
  2. int git_oid_fromstr(.git_oid* out_, const(char)* str)
    version(!GIT_EXPERIMENTAL_SHA256)
    extern (C) nothrow @nogc public
    int
    git_oid_fromstr
    (,
    const(char)* str
    )

Parameters

out_ .git_oid*

oid structure the result is written into.

str const(char)*

input hex string; must be pointing at the start of the hex sequence and have at least the number of bytes needed for an oid encoded in hex (40 bytes for sha1, 256 bytes for sha256).

Return Value

Type: int

0 or an error code

Meta