Просмотр исходного кода

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 лет назад
Родитель
Сommit
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']