aboutsummaryrefslogtreecommitdiffstats
path: root/git-prune-script
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-07-08 10:57:21 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-08 10:57:21 -0700
commitb33e9666082ce692e64ccfd688dc2a5075566f75 (patch)
treec4c5637417a6e7c3e4c7d38b82e73cf4ef1c09fa /git-prune-script
parentacb46f8769dd0031a98a284e06ebc5a09b151bfd (diff)
downloadgit-b33e9666082ce692e64ccfd688dc2a5075566f75.tar.gz
Add "git-sh-setup-script" for common git shell script setup
It sets up the normal git environment variables and a few helper functions (currently just "die()"), and returns ok if it all looks like a git archive. So use it something like . git-sh-setup-script || die "Not a git archive" to make the rest of the git scripts more careful and readable.
Diffstat (limited to 'git-prune-script')
-rwxr-xr-xgit-prune-script6
1 files changed, 3 insertions, 3 deletions
diff --git a/git-prune-script b/git-prune-script
index ec9f72de79..97646685b7 100755
--- a/git-prune-script
+++ b/git-prune-script
@@ -1,4 +1,7 @@
#!/bin/sh
+
+. git-sh-setup-script || die "Not a git archive"
+
dryrun=
while case "$#" in 0) break ;; esac
do
@@ -11,9 +14,6 @@ do
shift;
done
-: ${GIT_DIR=.git}
-: ${GIT_OBJECT_DIRECTORY="${SHA1_FILE_DIRECTORY-"$GIT_DIR/objects"}"}
-
git-fsck-cache --cache --unreachable "$@" |
sed -ne '/unreachable /{
s/unreachable [^ ][^ ]* //