summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-12-28 15:17:33 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-12-28 15:17:33 (GMT)
commit05a51fa546a42560f505eacbbc1f01a809e5c5b8 (patch)
treec1fc1a2075d7999927dc27f3e07c66b02f894d3c
parent1236c80eb2f5c736a5e78fd52f138cd28b3650d5 (diff)
downloadmisc-05a51fa546a42560f505eacbbc1f01a809e5c5b8.zip
misc-05a51fa546a42560f505eacbbc1f01a809e5c5b8.tar.gz
misc-05a51fa546a42560f505eacbbc1f01a809e5c5b8.tar.bz2
censorgit/cg: new option --bare to suppress check of source repo
-rwxr-xr-xcensorgit/cg8
1 files changed, 6 insertions, 2 deletions
diff --git a/censorgit/cg b/censorgit/cg
index 5801afe..0be6594 100755
--- a/censorgit/cg
+++ b/censorgit/cg
@@ -3,16 +3,20 @@
usage()
{
- echo "usage: $0 [-d] [filter-options] src-repo dst-repo [-- range]" 2>&1
+ cat <<EOF 1>&2
+usage: $0 [-d] [--bare] [filter-options] src-repo dst-repo [-- range]
+EOF
exit 1
}
+bare=false
opts=
while [ "$1" ]; do
case "$1" in
-d) debug=true
set -x;;
+ --bare) bare=true;;
--) shift
break;;
--*) opts="$opts '$1'";;
@@ -25,7 +29,7 @@ done
src=$1
dst=$2
-[ -d "$src/.git" ] || {
+[ $bare -o -d "$src/.git" ] || {
echo "no $src/.git directory" 1>&2
exit 1
}