Browse Source

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>
maint
Alex Riesen 17 years ago committed by Junio C Hamano
parent
commit
301e42edc3
  1. 4
      builtin-checkout.c

4
builtin-checkout.c

@ -545,6 +545,10 @@ int cmd_checkout(int argc, const char **argv, const char *prefix) @@ -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) {

Loading…
Cancel
Save