summaryrefslogtreecommitdiff
path: root/builtin-checkout.c
diff options
context:
space:
mode:
authorAlex Riesen <raa.lkml@gmail.com>2008-02-28 17:30:47 +0100
committerJunio C Hamano <gitster@pobox.com>2008-02-29 00:00:29 -0800
commit301e42edc3fa277059be97b3be5b97d86ddc9d9f (patch)
tree9f102b3281ff3220f04ece2a1c4b0cb0c9b12ac7 /builtin-checkout.c
parent25c4f61c51a91051dcba3b8bbbac4c61aa69cc19 (diff)
downloadgit-301e42edc3fa277059be97b3be5b97d86ddc9d9f.tar.gz
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>
Diffstat (limited to 'builtin-checkout.c')
-rw-r--r--builtin-checkout.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin-checkout.c b/builtin-checkout.c
index 4a4bb8b77d..9579ff4ab1 100644
--- a/builtin-checkout.c
+++ b/builtin-checkout.c
@@ -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) {