repo.or.cz
/
git
/
gitweb.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[PATCH] Make .git directory validation code test HEAD
[git/gitweb.git]
/
git-sh-setup-script
blob
84e15df1bcedba39e9310700d2aa7bf14dde2395
1
#!/bin/sh
2
#
3
# Set up GIT_DIR and GIT_OBJECT_DIRECTORY
4
# and return true if everything looks ok
5
#
6
:
${GIT_DIR=.git}
7
:
${GIT_OBJECT_DIRECTORY="$GIT_DIR/objects"}
8
9
die
() {
10
echo
"$@"
>&
2
11
exit
1
12
}
13
14
[
-h
"
$GIT_DIR
/HEAD"
] &&
15
[
-d
"
$GIT_DIR
/refs"
] &&
16
[
-d
"
$GIT_OBJECT_DIRECTORY
/00"
]