• H
    Let submodule command exit with error status if path does not exist · be9d0a3a
    Heiko Voigt 提交于
    Various subcommands of the "git submodule" command exited with 0
    status even though the path given by the user did not exist.
    
    The reason behind that was that they all pipe the output of
    module_list into the while loop which then does the action on the
    paths specified by the commandline. Since the exit code of the
    command on the upstream side of the pipe is ignored by the shell,
    the status code of "ls-files --error-unmatch" nor "module_list" was
    not propagated.
    
    In case ls-files returns with an error code, we write a special
    string that is not possible in non error situations, and no other
    output, so that the downstream can detect the error and die with an
    error code.
    
    The error message that there is an unmatched pathspec comes through
    stderr directly from ls-files. So the user still gets a hint whats going
    on.
    Signed-off-by: NHeiko Voigt <hvoigt@hvoigt.net>
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    be9d0a3a
git-submodule.sh 22.5 KB