checkout: notice when the switched branch is behind or forked
[gitweb.git] / builtin-commit.c
index c63ff826fc1c87c232b61c0059f12bb26f3098b2..5b5b7c0f4df81f4200707e0cbe688b3873443125 100644 (file)
@@ -200,7 +200,8 @@ static void create_base_index(void)
                die("failed to unpack HEAD tree object");
        parse_tree(tree);
        init_tree_desc(&t, tree->buffer, tree->size);
-       unpack_trees(1, &t, &opts);
+       if (unpack_trees(1, &t, &opts))
+               exit(128); /* We've already reported the error, finish dying */
 }
 
 static char *prepare_index(int argc, const char **argv, const char *prefix)