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:

committed by
Junio C Hamano

parent
25c4f61c51
commit
301e42edc3
@ -545,6 +545,10 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
|
|||||||
|
|
||||||
if (argc) {
|
if (argc) {
|
||||||
const char **pathspec = get_pathspec(prefix, argv);
|
const char **pathspec = get_pathspec(prefix, argv);
|
||||||
|
|
||||||
|
if (!pathspec)
|
||||||
|
die("invalid path specification");
|
||||||
|
|
||||||
/* Checkout paths */
|
/* Checkout paths */
|
||||||
if (opts.new_branch || opts.force || opts.merge) {
|
if (opts.new_branch || opts.force || opts.merge) {
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
|
Reference in New Issue
Block a user