]> git.ipfire.org Git - thirdparty/git.git/blame - t/t6500-gc.sh
ref-filter: resurrect "strip" as a synonym to "lstrip"
[thirdparty/git.git] / t / t6500-gc.sh
CommitLineData
0c8151b6
NTND
1#!/bin/sh
2
3test_description='basic git gc tests
4'
5
6. ./test-lib.sh
7
8test_expect_success 'gc empty repository' '
9 git gc
10'
11
4c5baf02
JN
12test_expect_success 'gc does not leave behind pid file' '
13 git gc &&
14 test_path_is_missing .git/gc.pid
15'
16
0c8151b6
NTND
17test_expect_success 'gc --gobbledegook' '
18 test_expect_code 129 git gc --nonsense 2>err &&
9a001381 19 test_i18ngrep "[Uu]sage: git gc" err
0c8151b6
NTND
20'
21
22test_expect_success 'gc -h with invalid configuration' '
23 mkdir broken &&
24 (
25 cd broken &&
26 git init &&
27 echo "[gc] pruneexpire = CORRUPT" >>.git/config &&
28 test_expect_code 129 git gc -h >usage 2>&1
29 ) &&
9a001381 30 test_i18ngrep "[Uu]sage" broken/usage
0c8151b6
NTND
31'
32
14886b40 33test_expect_success 'gc is not aborted due to a stale symref' '
8c845cde
JS
34 git init remote &&
35 (
36 cd remote &&
37 test_commit initial &&
38 git clone . ../client &&
39 git branch -m develop &&
40 cd ../client &&
41 git fetch --prune &&
42 git gc
43 )
44'
45
0c8151b6 46test_done