Merge branch 'er/fast-import-dump-refs-on-checkpoint'
authorJunio C Hamano <gitster@pobox.com>
Thu, 5 Oct 2017 04:48:19 +0000 (13:48 +0900)
committerJunio C Hamano <gitster@pobox.com>
Thu, 5 Oct 2017 04:48:19 +0000 (13:48 +0900)
The checkpoint command "git fast-import" did not flush updates to
refs and marks unless at least one object was created since the
last checkpoint, which has been corrected, as these things can
happen without any new object getting created.

* er/fast-import-dump-refs-on-checkpoint:
fast-import: checkpoint: dump branches/tags/marks even if object_count==0

1  2 
fast-import.c
diff --combined fast-import.c
index 35bf671f12c41ce5a2a9f9224babee792bf71209,365d3191aa1abfb42b4d0da6973612126cc74f3b..d5e4cf0bad411dad859dbe421ab7583cfb0f1561
@@@ -167,7 -167,6 +167,7 @@@ Format of STDIN stream
  #include "quote.h"
  #include "dir.h"
  #include "run-command.h"
 +#include "packfile.h"
  
  #define PACK_ID_BITS 16
  #define MAX_PACK_ID ((1<<PACK_ID_BITS)-1)
@@@ -2952,7 -2951,7 +2952,7 @@@ static void parse_reset_branch(const ch
  
  static void cat_blob_write(const char *buf, unsigned long size)
  {
 -      if (write_in_full(cat_blob_fd, buf, size) != size)
 +      if (write_in_full(cat_blob_fd, buf, size) < 0)
                die_errno("Write to frontend failed");
  }
  
@@@ -3189,10 -3188,10 +3189,10 @@@ static void checkpoint(void
        checkpoint_requested = 0;
        if (object_count) {
                cycle_packfile();
-               dump_branches();
-               dump_tags();
-               dump_marks();
        }
+       dump_branches();
+       dump_tags();
+       dump_marks();
  }
  
  static void parse_checkpoint(void)