Commit Diff


commit - a8d761ba53d1d4ec1c569d0ecf972e72997824bd
commit + 9c9f0ee1557e3da23d5b12c598eb8e10e2c65d37
blob - a5d0bcb2233ff202330b3c197e216e3300f272f4
blob + a30589e672a0c2ca735d16a6ecde083ecf754389
--- gitwrapper/gitwrapper.c
+++ gitwrapper/gitwrapper.c
@@ -177,15 +177,20 @@ main(int argc, char *argv[])
 	repo = gotd_find_repo_by_name(repo_name, &gotd);
 
 	/*
-	 * Invoke our custom Git server if it was found in PATH and
-	 * if the repository was found in gotd.conf.
-	 * Otherwise invoke native git(1) tooling.
+	 * Invoke our custom Git server if the repository was found
+	 * in gotd.conf. Otherwise invoke native git(1) tooling.
 	 */
 	switch (pid = fork()) {
 	case -1:
 		goto done;
 	case 0:
-		if (repo && myserver) {
+		if (repo) {
+			if (myserver == NULL) {
+				error = got_error_fmt(GOT_ERR_NO_PROG,
+				    "cannot run '%s'",
+				    GITWRAPPER_MY_SERVER_PROG);
+				goto done;
+			}
 			if (execl(myserver, command, repo_name,
 			    (char *)NULL) ==  -1) {
 				error = got_error_from_errno2("execl",
blob - 53f181cbdaef76fe21b918d662302e97c34c6b3b
blob + 3b047e438a7e4fff23c4e9f6c1ada623765a80dc
--- include/got_error.h
+++ include/got_error.h
@@ -184,6 +184,7 @@
 #define GOT_ERR_COMMIT_BAD_AUTHOR 166
 #define GOT_ERR_UID		167
 #define GOT_ERR_GID		168
+#define GOT_ERR_NO_PROG		169
 
 struct got_error {
         int code;
blob - 65f80e0880b3c1a7d26448fd7d30e83e481613c9
blob + 4129783e86df8d634cf23282925d3ef4658cafaa
--- lib/error.c
+++ lib/error.c
@@ -241,6 +241,7 @@ static const struct got_error got_errors[] = {
 	    "make Git unhappy" },
 	{ GOT_ERR_UID, "bad user ID" },
 	{ GOT_ERR_GID, "bad group ID" },
+	{ GOT_ERR_NO_PROG, "command not found or not accessible" },
 };
 
 static struct got_custom_error {