sequencer: introduce todo_list_write_to_file()
[gitweb.git] / builtin / fetch-pack.c
index f9d7d0b5a519a94317326e0b1baa562aade639a2..63e69a58011a4d3c774cd3c81ae9f10e3a96efe6 100644 (file)
@@ -16,13 +16,14 @@ static void add_sought_entry(struct ref ***sought, int *nr, int *alloc,
 {
        struct ref *ref;
        struct object_id oid;
+       const char *p;
 
-       if (!get_oid_hex(name, &oid)) {
-               if (name[GIT_SHA1_HEXSZ] == ' ') {
-                       /* <sha1> <ref>, find refname */
-                       name += GIT_SHA1_HEXSZ + 1;
-               } else if (name[GIT_SHA1_HEXSZ] == '\0') {
-                       ; /* <sha1>, leave sha1 as name */
+       if (!parse_oid_hex(name, &oid, &p)) {
+               if (*p == ' ') {
+                       /* <oid> <ref>, find refname */
+                       name = p + 1;
+               } else if (*p == '\0') {
+                       ; /* <oid>, leave oid as name */
                } else {
                        /* <ref>, clear cruft from oid */
                        oidclr(&oid);
@@ -55,6 +56,8 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
        struct string_list deepen_not = STRING_LIST_INIT_DUP;
        struct packet_reader reader;
 
+       fetch_if_missing = 0;
+
        packet_trace_identity("fetch-pack");
 
        memset(&args, 0, sizeof(args));
@@ -145,6 +148,22 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
                        args.update_shallow = 1;
                        continue;
                }
+               if (!strcmp("--from-promisor", arg)) {
+                       args.from_promisor = 1;
+                       continue;
+               }
+               if (!strcmp("--no-dependents", arg)) {
+                       args.no_dependents = 1;
+                       continue;
+               }
+               if (skip_prefix(arg, ("--" CL_ARG__FILTER "="), &arg)) {
+                       parse_list_objects_filter(&args.filter_options, arg);
+                       continue;
+               }
+               if (!strcmp(arg, ("--no-" CL_ARG__FILTER))) {
+                       list_objects_filter_set_no_filter(&args.filter_options);
+                       continue;
+               }
                usage(fetch_pack_usage);
        }
        if (deepen_not.nr)