8 [ -d "$cfg_reporoot/$proj.git" ] ||
{ echo "Invalid project name: $1" >&2; exit 1; }
10 projdir
="$cfg_reporoot/$proj.git"
12 [ -L "$projdir/HEAD" ] ||
13 ! [ -f "$projdir/HEAD" ] ||
14 ! [ -f "$projdir/config" ] ||
15 ! [ -f "$projdir/description" ] ||
16 ! [ -d "$projdir/objects" ] ||
17 ! [ -d "$projdir/refs" ] ||
18 ! [ -d "$projdir/info" ]
20 echo "Incorrectly set up project: $1" >&2
26 mkdir
-p "$projdir/private/refs"
27 chmod 02775 "$projdir/private" "$projdir/private/refs" ||
28 echo "Warning: could not chmod 02775 on all dirs" >&2
30 [ -e "$projdir/private/gc.pid" ] ||
printf '%s' '0 Private' >"$projdir/private/gc.pid"
31 [ -e "$projdir/private/objects" ] ||
ln -sfn ..
/objects
"$projdir/private/objects"
32 [ -e "$projdir/private/config" ] ||
cat <<EOT >"$projdir/private/config"
34 repositoryFormatVersion = 0
38 sharedrepository = $cfg_git_shared_repository_setting
40 logAllRefUpdates = false
41 hooksPath = "$cfg_reporoot/_global/empty"
43 preciousObjects = true
50 pcval
="$(git --git-dir="$projdir" config --file "$projdir/config
" --bool --get "core.precomposeunicode
" 2>/dev/null)" ||
:
51 [ -z "$pcval" ] || git
--git-dir="$projdir" config
--file "$projdir/private/config" "core.precomposeunicode" "$pcval"
53 if [ ! -e "$projdir/private/HEAD" ]; then
54 printf '%s\n' "ref: refs/heads/{private}" >"$projdir/private/HEAD.$$"
55 mv -f "$projdir/private/HEAD.$$" "$projdir/private/HEAD"
56 rm -f "$projdir/private/HEAD.$$"
59 is_git_dir
"$projdir/private" ||
{
60 echo "Unable to set up private area in project: $1" >&2