builtin-am: invoke post-rewrite hook
[gitweb.git] / builtin / bundle.c
index 9b87fb9ac2505e746ae34db34740cdfb3cfde127..4883a435a9afc607618d34c9b61b218eeda7de45 100644 (file)
@@ -42,9 +42,13 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)
 
        if (!strcmp(cmd, "verify")) {
                close(bundle_fd);
+               if (argc != 1) {
+                       usage(builtin_bundle_usage);
+                       return 1;
+               }
                if (verify_bundle(&header, 1))
                        return 1;
-               fprintf(stderr, "%s is okay\n", bundle_file);
+               fprintf(stderr, _("%s is okay\n"), bundle_file);
                return 0;
        }
        if (!strcmp(cmd, "list-heads")) {
@@ -52,13 +56,17 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)
                return !!list_bundle_refs(&header, argc, argv);
        }
        if (!strcmp(cmd, "create")) {
+               if (argc < 2) {
+                       usage(builtin_bundle_usage);
+                       return 1;
+               }
                if (!startup_info->have_repository)
-                       die("Need a repository to create a bundle.");
+                       die(_("Need a repository to create a bundle."));
                return !!create_bundle(&header, bundle_file, argc, argv);
        } else if (!strcmp(cmd, "unbundle")) {
                if (!startup_info->have_repository)
-                       die("Need a repository to unbundle.");
-               return !!unbundle(&header, bundle_fd) ||
+                       die(_("Need a repository to unbundle."));
+               return !!unbundle(&header, bundle_fd, 0) ||
                        list_bundle_refs(&header, argc, argv);
        } else
                usage(builtin_bundle_usage);