2010-10-22 08:47:19 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
test_description='basic git gc tests
|
|
|
|
'
|
|
|
|
|
|
|
|
. ./test-lib.sh
|
|
|
|
|
|
|
|
test_expect_success 'gc empty repository' '
|
|
|
|
git gc
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'gc --gobbledegook' '
|
|
|
|
test_expect_code 129 git gc --nonsense 2>err &&
|
2012-08-27 07:36:55 +02:00
|
|
|
test_i18ngrep "[Uu]sage: git gc" err
|
2010-10-22 08:47:19 +02:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'gc -h with invalid configuration' '
|
|
|
|
mkdir broken &&
|
|
|
|
(
|
|
|
|
cd broken &&
|
|
|
|
git init &&
|
|
|
|
echo "[gc] pruneexpire = CORRUPT" >>.git/config &&
|
|
|
|
test_expect_code 129 git gc -h >usage 2>&1
|
|
|
|
) &&
|
2012-08-27 07:36:55 +02:00
|
|
|
test_i18ngrep "[Uu]sage" broken/usage
|
2010-10-22 08:47:19 +02:00
|
|
|
'
|
|
|
|
|
|
|
|
test_done
|