Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Tue, 15 Oct 2013 23:15:00 +0000 (16:15 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 15 Oct 2013 23:15:00 +0000 (16:15 -0700)
* maint:
git-prune-packed.txt: fix reference to GIT_OBJECT_DIRECTORY
clone --branch: refuse to clone if upstream repo is empty

1  2 
builtin/clone.c
diff --combined builtin/clone.c
index 0aff974a64c9cbb035f77c82b22d35c8249fcf1f,21ad9f945c019625ace5f5dba0d4e54a8b2bb70f..b708c115a344974b79501ec896ce87ad30905450
@@@ -62,22 -62,23 +62,22 @@@ static struct option builtin_clone_opti
        OPT__VERBOSITY(&option_verbosity),
        OPT_BOOL(0, "progress", &option_progress,
                 N_("force progress reporting")),
 -      OPT_BOOLEAN('n', "no-checkout", &option_no_checkout,
 -                  N_("don't create a checkout")),
 -      OPT_BOOLEAN(0, "bare", &option_bare, N_("create a bare repository")),
 -      { OPTION_BOOLEAN, 0, "naked", &option_bare, NULL,
 -              N_("create a bare repository"),
 -              PARSE_OPT_NOARG | PARSE_OPT_HIDDEN },
 -      OPT_BOOLEAN(0, "mirror", &option_mirror,
 -                  N_("create a mirror repository (implies bare)")),
 +      OPT_BOOL('n', "no-checkout", &option_no_checkout,
 +               N_("don't create a checkout")),
 +      OPT_BOOL(0, "bare", &option_bare, N_("create a bare repository")),
 +      OPT_HIDDEN_BOOL(0, "naked", &option_bare,
 +                      N_("create a bare repository")),
 +      OPT_BOOL(0, "mirror", &option_mirror,
 +               N_("create a mirror repository (implies bare)")),
        OPT_BOOL('l', "local", &option_local,
                N_("to clone from a local repository")),
 -      OPT_BOOLEAN(0, "no-hardlinks", &option_no_hardlinks,
 +      OPT_BOOL(0, "no-hardlinks", &option_no_hardlinks,
                    N_("don't use local hardlinks, always copy")),
 -      OPT_BOOLEAN('s', "shared", &option_shared,
 +      OPT_BOOL('s', "shared", &option_shared,
                    N_("setup as shared repository")),
 -      OPT_BOOLEAN(0, "recursive", &option_recursive,
 +      OPT_BOOL(0, "recursive", &option_recursive,
                    N_("initialize submodules in the clone")),
 -      OPT_BOOLEAN(0, "recurse-submodules", &option_recursive,
 +      OPT_BOOL(0, "recurse-submodules", &option_recursive,
                    N_("initialize submodules in the clone")),
        OPT_STRING(0, "template", &option_template, N_("template-directory"),
                   N_("directory from which templates will be used")),
@@@ -556,7 -557,7 +556,7 @@@ static void update_remote_refs(const st
                                                              0, &rm, transport))
                        die(_("remote did not send all necessary objects"));
                if (0 <= option_verbosity)
 -                      printf(_("done\n"));
 +                      printf(_("done.\n"));
        }
  
        if (refs) {
@@@ -945,6 -946,10 +945,10 @@@ int cmd_clone(int argc, const char **ar
                        our_head_points_at = remote_head_points_at;
        }
        else {
+               if (option_branch)
+                       die(_("Remote branch %s not found in upstream %s"),
+                                       option_branch, option_origin);
                warning(_("You appear to have cloned an empty repository."));
                mapped_refs = NULL;
                our_head_points_at = NULL;