projects
/
config
/
vcsh.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
populate-fully.sh: don't do anything if the repository does not exist
[config/vcsh.git]
/
.config
/
vcsh
/
hooks-available
/
populate-fully.sh
diff --git
a/.config/vcsh/hooks-available/populate-fully.sh
b/.config/vcsh/hooks-available/populate-fully.sh
index
46e155f
..
b038d1e
100755
(executable)
--- a/
.config/vcsh/hooks-available/populate-fully.sh
+++ b/
.config/vcsh/hooks-available/populate-fully.sh
@@
-2,7
+2,10
@@
set -e
set -e
-# Only one vcsh instance at a time can have the work dir fully populated.
+# If the vcsh repository does not exist, exit without doing anything.
+[ -d "$GIT_DIR" ] || exit 0
+
+# Only one vcsh instance at a time can have the working tree fully populated.
LOCKDIR=/run/lock/vcsh
# Kill the parent process because vcsh does not catch the hook exit value.
LOCKDIR=/run/lock/vcsh
# Kill the parent process because vcsh does not catch the hook exit value.
@@
-13,7
+16,7
@@
mkdir "$LOCKDIR" 2>/dev/null || { echo "An instance of vcsh already entered a re
echo $PPID > "$LOCKDIR/pid"
# git read-tree manual page says this is the proper way to fully repopulate
echo $PPID > "$LOCKDIR/pid"
# git read-tree manual page says this is the proper way to fully repopulate
-# the working
directory
+# the working
tree.
git config core.sparseCheckout true
rm -f "$GIT_DIR/info/sparse-checkout"
echo "/*" > "$GIT_DIR/info/sparse-checkout"
git config core.sparseCheckout true
rm -f "$GIT_DIR/info/sparse-checkout"
echo "/*" > "$GIT_DIR/info/sparse-checkout"