1#!/bin/sh
2#
3# Copyright (c) 2005 Linus Torvalds
4#
5
6. git-sh-setup-script || die "Not a git archive"
7
8no_update_info=
9while case "$#" in 0) break ;; esac
10do
11 case "$1" in
12 -n) no_update_info=t ;;
13 *) break ;;
14 esac
15 shift
16done
17
18rm -f .tmp-pack-*
19packname=$(git-rev-list --unpacked --objects $(git-rev-parse --all) |
20 git-pack-objects --non-empty --incremental .tmp-pack) ||
21 exit 1
22if [ -z "$packname" ]; then
23 echo Nothing new to pack
24 exit 0
25fi
26
27mkdir -p "$GIT_OBJECT_DIRECTORY/pack" &&
28mv .tmp-pack-$packname.pack "$GIT_OBJECT_DIRECTORY/pack/pack-$packname.pack" &&
29mv .tmp-pack-$packname.idx "$GIT_OBJECT_DIRECTORY/pack/pack-$packname.idx" &&
30case "$no_update_info" in
31t) : ;;
32*) git-update-server-info ;;
33esac