[PATCH 7/25] git-count-objects: Die with usage message if we are invoked incorrectly.
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
---
git-count-objects.sh | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
5db708396a841860c4d5e41c2acd60476d2207c4
diff --git a/git-count-objects.sh b/git-count-objects.sh
index 40c58ef..0d544ad 100755
--- a/git-count-objects.sh
+++ b/git-count-objects.sh
@@ -3,7 +3,16 @@
# Copyright (c) 2005 Junio C Hamano
#
-GIT_DIR=`git-rev-parse --git-dir` || exit $?
+. git-sh-setup
+
+usage () {
+ die "usage: $0"
+}
+
+if [ "$#" != "0" ]
+then
+ usage
+fi
dc </dev/null 2>/dev/null || {
# This is not a real DC at all -- it just knows how
--
0.99.9.GIT