Fix builtin checkout crashing when given an invalid path

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Alex Riesen 2008-02-28 17:30:47 +01:00 committed by Junio C Hamano
parent 25c4f61c51
commit 301e42edc3

View File

@ -545,6 +545,10 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
if (argc) {
const char **pathspec = get_pathspec(prefix, argv);
if (!pathspec)
die("invalid path specification");
/* Checkout paths */
if (opts.new_branch || opts.force || opts.merge) {
if (argc == 1) {