Use local structs for HTTP slot callback data
[git.git] / rev-list.c
index 0b142c1..1bc1887 100644 (file)
@@ -749,6 +749,21 @@ int main(int argc, const char **argv)
                struct commit *commit;
                unsigned char sha1[20];
 
+               /* accept -<digit>, like traditilnal "head" */
+               if ((*arg == '-') && isdigit(arg[1])) {
+                       max_count = atoi(arg + 1);
+                       continue;
+               }
+               if (!strcmp(arg, "-n")) {
+                       if (++i >= argc)
+                               die("-n requires an argument");
+                       max_count = atoi(argv[i]);
+                       continue;
+               }
+               if (!strncmp(arg,"-n",2)) {
+                       max_count = atoi(arg + 2);
+                       continue;
+               }
                if (!strncmp(arg, "--max-count=", 12)) {
                        max_count = atoi(arg + 12);
                        continue;