소스 검색

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']