aboutsummaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorAlex Pooley (@zuedev) <zuedev@gmail.com>2026-05-07 18:10:12 +0100
committerAlex Pooley (@zuedev) <zuedev@gmail.com>2026-05-07 18:10:12 +0100
commitcf072ba19c0883aa159c0155ccb317ac28e0d775 (patch)
tree2c39ce9cffef179f3846066f4843b4d786290235 /usr
parent23e43bfc60ea4bc7ff1c34dfce54e838c88ba9f3 (diff)
downloadgit.zue.dev-cf072ba19c0883aa159c0155ccb317ac28e0d775.tar
git.zue.dev-cf072ba19c0883aa159c0155ccb317ac28e0d775.tar.gz
git.zue.dev-cf072ba19c0883aa159c0155ccb317ac28e0d775.tar.bz2
git.zue.dev-cf072ba19c0883aa159c0155ccb317ac28e0d775.tar.xz
git.zue.dev-cf072ba19c0883aa159c0155ccb317ac28e0d775.zip
Check if the repository exists at the specified path
Diffstat (limited to 'usr')
-rw-r--r--usr/local/bin/git-wrapper7
1 files changed, 7 insertions, 0 deletions
diff --git a/usr/local/bin/git-wrapper b/usr/local/bin/git-wrapper
index 3039d10..456a289 100644
--- a/usr/local/bin/git-wrapper
+++ b/usr/local/bin/git-wrapper
@@ -22,6 +22,13 @@ case "$cmd" in
git-upload-pack|git-receive-pack|git-upload-archive)
# If the path is not an absolute path, prefix it with /repositories to ensure that all git operations are confined to the /repositories directory.
[[ "$path" != /* ]] && path="/repositories/$path"
+
+ # Check if the repository exists at the specified path
+ if [ ! -d "$path" ]; then
+ echo "Repository not found: $path" >&2
+ exit 1
+ fi
+
exec "$cmd" "$path"
;;
# If the command is not one of the allowed git commands, reject it and print an error message.