Merge branch 'fc/fast-export-persistent-marks'
authorJunio C Hamano <gitster@pobox.com>
Sun, 2 Jun 2013 22:48:28 +0000 (15:48 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 2 Jun 2013 22:48:28 +0000 (15:48 -0700)
Optimization for fast-export by avoiding unnecessarily resolving
arbitrary object name and parsing object when only presence and
type information is necessary, etc.

* fc/fast-export-persistent-marks:
fast-{import,export}: use get_sha1_hex() to read from marks file
fast-export: don't parse commits while reading marks file
fast-export: do not parse non-commit objects while reading marks file

1  2 
fast-import.c
diff --combined fast-import.c
index 6d9445302614318c0322fdb2fc403aa22cd79804,3f3214935f498c6a53a705a70a782d28ab8b3c12..23f625f561dfd664a460827d507e7c0b720e9849
@@@ -297,7 -297,7 +297,7 @@@ static int failure
  static FILE *pack_edges;
  static unsigned int show_stats = 1;
  static int global_argc;
 -static const char **global_argv;
 +static char **global_argv;
  
  /* Memory pools */
  static size_t mem_pool_alloc = 2*1024*1024 - sizeof(struct mem_pool);
@@@ -1822,7 -1822,7 +1822,7 @@@ static void read_marks(void
                *end = 0;
                mark = strtoumax(line + 1, &end, 10);
                if (!mark || end == line + 1
-                       || *end != ' ' || get_sha1(end + 1, sha1))
+                       || *end != ' ' || get_sha1_hex(end + 1, sha1))
                        die("corrupt mark line: %s", line);
                e = find_object(sha1);
                if (!e) {
@@@ -3347,7 -3347,7 +3347,7 @@@ static void parse_argv(void
                read_marks();
  }
  
 -int main(int argc, const char **argv)
 +int main(int argc, char **argv)
  {
        unsigned int i;