Thread (5 messages) flat view 5 messages, 3 authors, 2016-06-15
DORMANTno replies

[PATCH] shortlog: initialize nongit variable

From: SZEDER Gábor <hidden>
Date: 2016-06-15 22:44:25
Subsystem: the rest · Maintainer: Linus Torvalds

setup_git_directory_gently() only modifies the value of the nongit
variable if we are not in a git repository, therefore nongit is left
uninitialized if we are in a git repository.  This sometimes broke
shortlog when it was not fed with a log on its standard input.

Signed-off-by: SZEDER Gábor <redacted>
---
 builtin-shortlog.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-shortlog.c b/builtin-shortlog.c
index bd795b1..60a6d45 100644
--- a/builtin-shortlog.c
+++ b/builtin-shortlog.c
@@ -229,7 +229,7 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix)
 {
 	struct shortlog log;
 	struct rev_info rev;
-	int nongit;
+	int nongit = 0;
 
 	prefix = setup_git_directory_gently(&nongit);
 	shortlog_init(&log);
-- 
1.5.5.rc1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help