diff options
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/clone.c | 2 | ||||
-rw-r--r-- | builtin/diff.c | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/builtin/clone.c b/builtin/clone.c index 61e0989b5a..82a6938620 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -66,7 +66,7 @@ static struct option builtin_clone_options[] = { "setup as shared repository"), OPT_BOOLEAN(0, "recursive", &option_recursive, "initialize submodules in the clone"), - OPT_BOOLEAN(0, "recurse_submodules", &option_recursive, + OPT_BOOLEAN(0, "recurse-submodules", &option_recursive, "initialize submodules in the clone"), OPT_STRING(0, "template", &option_template, "path", "path the template repository"), diff --git a/builtin/diff.c b/builtin/diff.c index 945e7583a8..42822cd537 100644 --- a/builtin/diff.c +++ b/builtin/diff.c @@ -330,8 +330,11 @@ int cmd_diff(int argc, const char **argv, const char *prefix) else if (!strcmp(arg, "--cached") || !strcmp(arg, "--staged")) { add_head_to_pending(&rev); - if (!rev.pending.nr) - die("No HEAD commit to compare with (yet)"); + if (!rev.pending.nr) { + struct tree *tree; + tree = lookup_tree((const unsigned char*)EMPTY_TREE_SHA1_BIN); + add_pending_object(&rev, &tree->object, "HEAD"); + } break; } } |