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>
Alex Riesen committed
Feb 28, 2008 at 17:30 UTC
301e42edc3fa277059be97b3be5b97d86ddc9d9f
1 file changed
+4
builtin-checkout.c
+4
@@ -545,6 +545,10 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
545
546
if (argc) {
547
const char **pathspec = get_pathspec(prefix, argv);
548
+
549
+ if (!pathspec)
550
+ die("invalid path specification");
551
+
552
/* Checkout paths */
553
if (opts.new_branch || opts.force || opts.merge) {
554
if (argc == 1) {