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/helper/test-name-hash.c # 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 / helper / test-name-hash.c` 23 lines ยท 539 bytes Raw Blame History 1 /* 2 * test-name-hash.c: Read a list of paths over stdin and report on their 3 * name-hash and full name-hash. 4 */ 5 6 #include "test-tool.h" 7 #include "git-compat-util.h" 8 #include "pack-objects.h" 9 #include "strbuf.h" 10 11 int cmd__name_hash(int argc UNUSED, const char **argv UNUSED) 12 { 13 struct strbuf line = STRBUF_INIT; 14 15 while (!strbuf_getline(&line, stdin)) { 16 printf("%10u ", pack_name_hash(line.buf)); 17 printf("%10u ", pack_name_hash_v2((unsigned const char *)line.buf)); 18 printf("%s\n", line.buf); 19 } 20 21 strbuf_release(&line); 22 return 0; 23 }