You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
498 B
19 lines
498 B
20 years ago
|
#!/bin/sh
|
||
|
: ${GIT_DIR=.git}
|
||
|
: ${GIT_OBJECT_DIRECTORY="$GIT_DIR/objects"}
|
||
|
packname=$(date +"pack-%s")
|
||
|
if [ -f "$GIT_OBJECT_DIRECTORY/pack/$packname.idx" ]; then
|
||
|
echo Pack $packname already exists
|
||
|
exit 1
|
||
|
fi
|
||
|
rm -f $packname.idx $packname.pack
|
||
|
git-rev-list --unpacked --objects $(git-rev-parse --all) |
|
||
|
git-pack-objects --non-empty --incremental $packname ||
|
||
|
exit 1
|
||
|
|
||
|
if [ ! -f $packname.idx ]; then
|
||
|
echo Nothing new to pack
|
||
|
exit 0
|
||
|
fi
|
||
|
mv $packname.idx $packname.pack "$GIT_OBJECT_DIRECTORY/pack/"
|