2005-07-03 20:38:01 +00:00
|
|
|
#!/bin/sh
|
2005-08-24 17:40:58 +00:00
|
|
|
#
|
|
|
|
# Copyright (c) 2005 Linus Torvalds
|
|
|
|
#
|
|
|
|
|
2005-07-08 17:57:21 +00:00
|
|
|
. git-sh-setup-script || die "Not a git archive"
|
|
|
|
|
2005-08-24 17:40:58 +00:00
|
|
|
no_update_info=
|
|
|
|
while case "$#" in 0) break ;; esac
|
|
|
|
do
|
|
|
|
case "$1" in
|
|
|
|
-n) no_update_info=t ;;
|
|
|
|
*) break ;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
2005-07-03 22:34:04 +00:00
|
|
|
rm -f .tmp-pack-*
|
|
|
|
packname=$(git-rev-list --unpacked --objects $(git-rev-parse --all) |
|
|
|
|
git-pack-objects --non-empty --incremental .tmp-pack) ||
|
2005-07-03 20:38:01 +00:00
|
|
|
exit 1
|
2005-07-03 22:34:04 +00:00
|
|
|
if [ -z "$packname" ]; then
|
2005-07-03 20:38:01 +00:00
|
|
|
echo Nothing new to pack
|
|
|
|
exit 0
|
|
|
|
fi
|
2005-08-24 17:40:58 +00:00
|
|
|
|
2005-07-08 17:57:21 +00:00
|
|
|
mkdir -p "$GIT_OBJECT_DIRECTORY/pack" &&
|
|
|
|
mv .tmp-pack-$packname.pack "$GIT_OBJECT_DIRECTORY/pack/pack-$packname.pack" &&
|
2005-08-24 17:40:58 +00:00
|
|
|
mv .tmp-pack-$packname.idx "$GIT_OBJECT_DIRECTORY/pack/pack-$packname.idx" &&
|
|
|
|
case "$no_update_info" in
|
|
|
|
t) : ;;
|
|
|
|
*) git-update-server-info ;;
|
|
|
|
esac
|