Documentation/build-docdep.perl: Fix dependencies for included asciidoc files
[git/mjg.git] / git-gc.sh
blob1a45de5dff7763fbca2a9076a4d3bdb0ed903439
1 #!/bin/sh
3 # Copyright (c) 2006, Shawn O. Pearce
5 # Cleanup unreachable files and optimize the repository.
7 USAGE='git-gc [--prune]'
8 SUBDIRECTORY_OK=Yes
9 . git-sh-setup
11 no_prune=:
12 while case $# in 0) break ;; esac
14 case "$1" in
15 --prune)
16 no_prune=
18 --)
19 usage
21 esac
22 shift
23 done
25 case "$(git config --get gc.packrefs)" in
26 notbare|"")
27 test $(is_bare_repository) = true || pack_refs=true;;
29 pack_refs=$(git config --bool --get gc.packrefs)
30 esac
32 test "true" != "$pack_refs" ||
33 git-pack-refs --prune &&
34 git-reflog expire --all &&
35 git-repack -a -d -l &&
36 $no_prune git-prune &&
37 git-rerere gc || exit