Skip to content

Commit f28dd47

Browse files
g-papegitster
authored andcommitted
git-clone: improve error message if curl program is missing or not executable
If the curl program is not available (or not executable), and git clone is started to clone a repository through http, this is the output Initialized empty Git repository in /tmp/puppet/.git/ /usr/bin/git-clone: line 37: curl: command not found Cannot get remote repository information. Perhaps git-update-server-info needs to be run there? This patch improves the error message by checking the return code when running curl to exit immediately if it's 126 or 127; the error output now is Initialized empty Git repository in /tmp/puppet/.git/ /usr/bin/git-clone: line 37: curl: command not found Adrian Bridgett noticed this and reported through http://bugs.debian.org/440976 Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent c32da69 commit f28dd47

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

git-clone.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ fi
3434

3535
http_fetch () {
3636
# $1 = Remote, $2 = Local
37-
curl -nsfL $curl_extra_args "$1" >"$2"
37+
curl -nsfL $curl_extra_args "$1" >"$2" ||
38+
case $? in
39+
126|127) exit ;;
40+
*) return $? ;;
41+
esac
3842
}
3943

4044
clone_dumb_http () {

0 commit comments

Comments
 (0)