author | Michael Schubert <mschub@elegosoft.com> | |
Wed, 18 May 2011 20:06:00 +0000 (22:06 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 18 May 2011 21:37:46 +0000 (14:37 -0700) | ||
commit | a87247731e46255567ec58df940adb697e5b95a8 | |
tree | 97e0132adc9036261df4ad278577c3770b77ebe7 | tree | snapshot |
parent | b602ed7dea968d72c5b3f61ca016de7f285d80ef | commit | diff |
ls-remote: the --exit-code option reports "no matching refs"
The "git ls-remote" uses its exit status to indicate if it successfully
talked with the remote repository. A new option "--exit-code" makes the
command exit with status "2" when there is no refs to be listed, even when
the command successfully talked with the remote repository.
This way, the caller can tell if we failed to contact the remote, or the
remote did not have what we wanted to see. Of course, you can inspect the
output from the command, which has been and will continue to be a valid
way to check the same thing.
Signed-off-by: Michael Schubert <mschub@elegosoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The "git ls-remote" uses its exit status to indicate if it successfully
talked with the remote repository. A new option "--exit-code" makes the
command exit with status "2" when there is no refs to be listed, even when
the command successfully talked with the remote repository.
This way, the caller can tell if we failed to contact the remote, or the
remote did not have what we wanted to see. Of course, you can inspect the
output from the command, which has been and will continue to be a valid
way to check the same thing.
Signed-off-by: Michael Schubert <mschub@elegosoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-ls-remote.txt | diff | blob | history | |
builtin/ls-remote.c | diff | blob | history | |
t/t5512-ls-remote.sh | diff | blob | history |