Skip to content

Commit

Permalink
Fix builtin checkout crashing when given an invalid path
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Alex Riesen authored and Junio C Hamano committed Feb 29, 2008
1 parent 25c4f61 commit 301e42e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions builtin-checkout.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 301e42e

Please sign in to comment.