projects
/
config
/
vcsh.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
20cf74a
)
populate-fully.sh: don't do anything if the repository does not exist
author
Antonio Ospite <ao2@ao2.it>
Thu, 13 Dec 2018 22:47:47 +0000
(23:47 +0100)
committer
Antonio Ospite <ao2@ao2.it>
Thu, 13 Dec 2018 22:47:47 +0000
(23:47 +0100)
The pre-enter hook is called even when trying to enter an invalid
repository, vcsh only checks the repository validity later on.
Anticipate the check and avoid calling git commands on an invalid
repository as they would just fail and confuse the user.
.config/vcsh/hooks-available/populate-fully.sh
patch
|
blob
|
history
diff --git
a/.config/vcsh/hooks-available/populate-fully.sh
b/.config/vcsh/hooks-available/populate-fully.sh
index
1b2c612
..
b038d1e
100755
(executable)
--- a/
.config/vcsh/hooks-available/populate-fully.sh
+++ b/
.config/vcsh/hooks-available/populate-fully.sh
@@
-2,6
+2,9
@@
set -e
+# 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