瀏覽代碼

Fix running gitstats with a non-tty stdin.

The following command used to fail because git shortlog has some witty magic to
decide the behaviour based on whether stdin is a terminal:

./gitstats /repo /dst < /dev/null

effectively causing a lot of shell scripts calling gitstats to fail with
"Division by zero" in author statistics.

Thanks-to: Bertrand Jacquin <beber@meleeweb.net>
Thanks-to: Sylvain Rabot <sylvain@abstraction.fr>
Heikki Hokkanen 15 年之前
父節點
當前提交
5e11dfbe32
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      gitstats

+ 1
- 1
gitstats 查看文件

@@ -59,7 +59,7 @@ def getpipeoutput(cmds, quiet = False):
59 59
 	exectime_external += (end - start)
60 60
 	return output.rstrip('\n')
61 61
 
62
-def getcommitrange(defaultrange = '', end_only = False):
62
+def getcommitrange(defaultrange = 'HEAD', end_only = False):
63 63
 	if len(conf['commit_end']) > 0:
64 64
 		if end_only or len(conf['commit_begin']) == 0:
65 65
 			return conf['commit_end']