Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/unit-tests/lib-oid.h # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / unit-tests / lib-oid.h` 28 lines ยท 910 bytes Raw Blame History 1 #ifndef LIB_OID_H 2 #define LIB_OID_H 3 4 #include "hash.h" 5 6 /* 7 * Convert arbitrary hex string to object_id. 8 * 9 * For example, passing "abc12" will generate 10 * "`abc1200000000000000000000000000000000000`" hex of length 40 for SHA-1 and 11 * create object_id with that. 12 * WARNING: passing a string of length more than the hexsz of respective hash 13 * algo is not allowed. The hash algo is decided based on GIT_TEST_DEFAULT_HASH 14 * environment variable. 15 */ 16 17 void cl_parse_any_oid (const char *s, struct object_id *oid); 18 /* 19 * Returns one of GIT_HASH_{SHA1, SHA256, UNKNOWN} based on the value of 20 * GIT_TEST_DEFAULT_HASH environment variable. The fallback value in the 21 * absence of GIT_TEST_DEFAULT_HASH is GIT_HASH_SHA1. It also uses 22 * cl_assert(algo != GIT_HASH_UNKNOWN) before returning to verify if the 23 * GIT_TEST_DEFAULT_HASH's value is valid or not. 24 */ 25 26 int cl_setup_hash_algo(void); 27 28 #endif /* LIB_OID_H */