From a19f901d9f07b07abd2bfbad62037b9783fcaa7c Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 10 Nov 2006 13:36:44 -0800 Subject: [PATCH 1/2] git-annotate: no need to exec blame; it is built-in now. --- builtin-annotate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin-annotate.c b/builtin-annotate.c index 25ad473711..57c46840d5 100644 --- a/builtin-annotate.c +++ b/builtin-annotate.c @@ -4,7 +4,7 @@ * Copyright (C) 2006 Ryan Anderson */ #include "git-compat-util.h" -#include "exec_cmd.h" +#include "builtin.h" int cmd_annotate(int argc, const char **argv, const char *prefix) { @@ -20,6 +20,6 @@ int cmd_annotate(int argc, const char **argv, const char *prefix) } nargv[argc + 1] = NULL; - return execv_git_cmd(nargv); + return cmd_blame(argc + 1, nargv, prefix); } From 8eaf79869f9eddf50ddffffb8d73a054e0514fcd Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 10 Nov 2006 13:39:01 -0800 Subject: [PATCH 2/2] git-annotate: fix -S on graft file with comments. The graft file can contain comment lines and read_graft_line can return NULL for such an input, which should be skipped by the reader. Signed-off-by: Junio C Hamano --- builtin-blame.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin-blame.c b/builtin-blame.c index 16660221c3..066dee743e 100644 --- a/builtin-blame.c +++ b/builtin-blame.c @@ -1407,7 +1407,8 @@ static int read_ancestry(const char *graft_file) /* The format is just "Commit Parent1 Parent2 ...\n" */ int len = strlen(buf); struct commit_graft *graft = read_graft_line(buf, len); - register_commit_graft(graft, 0); + if (graft) + register_commit_graft(graft, 0); } fclose(fp); return 0;