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/builtin/annotate.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 / builtin / annotate.c` 36 lines ยท 742 bytes Raw Blame History 1 /* 2 * "git annotate" builtin alias 3 * 4 * Copyright (C) 2006 Ryan Anderson 5 */ 6 7 #include "git-compat-util.h" 8 #include "builtin.h" 9 #include "strvec.h" 10 11 int cmd_annotate(int argc, 12 const char **argv, 13 const char *prefix, 14 struct repository *repo) 15 { 16 struct strvec args = STRVEC_INIT; 17 const char **args_copy; 18 int ret; 19 20 strvec_pushl(&args, "annotate", "-c", NULL); 21 for (int i = 1; i < argc; i++) 22 strvec_push(&args, argv[i]); 23 24 /* 25 * `cmd_blame()` ends up modifying the array, which causes memory leaks 26 * if we didn't copy the array here. 27 */ 28 CALLOC_ARRAY(args_copy, args.nr + 1); 29 COPY_ARRAY(args_copy, args.v, args.nr); 30 31 ret = cmd_blame(args.nr, args_copy, prefix, repo); 32 33 strvec_clear(&args); 34 free(args_copy); 35 return ret; 36 }