summaryrefslogtreecommitdiff
path: root/builtin-checkout.c
diff options
context:
space:
mode:
authorAlex Riesen <raa.lkml@gmail.com>2008-02-28 16:30:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-02-29 08:00:29 (GMT)
commit301e42edc3fa277059be97b3be5b97d86ddc9d9f (patch)
tree9f102b3281ff3220f04ece2a1c4b0cb0c9b12ac7 /builtin-checkout.c
parent25c4f61c51a91051dcba3b8bbbac4c61aa69cc19 (diff)
downloadgit-301e42edc3fa277059be97b3be5b97d86ddc9d9f.zip
git-301e42edc3fa277059be97b3be5b97d86ddc9d9f.tar.gz
git-301e42edc3fa277059be97b3be5b97d86ddc9d9f.tar.bz2
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 4a4bb8b..9579ff4 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) {