]> git.ipfire.org Git - thirdparty/git.git/blobdiff - vcs-svn/fast_export.c
Merge branch 'nm/maint-conflicted-submodule-entries'
[thirdparty/git.git] / vcs-svn / fast_export.c
index a4d4d9993dac74f0e751009f30588aef62d3a573..99ed70b88a5aaacbb48a9463f19ec198d7bedf84 100644 (file)
@@ -31,12 +31,14 @@ void fast_export_modify(uint32_t depth, uint32_t *path, uint32_t mode,
 }
 
 static char gitsvnline[MAX_GITSVN_LINE_LEN];
-void fast_export_commit(uint32_t revision, const char *author, char *log,
+void fast_export_commit(uint32_t revision, const char *author,
+                       const struct strbuf *log,
                        const char *uuid, const char *url,
                        unsigned long timestamp)
 {
+       static const struct strbuf empty = STRBUF_INIT;
        if (!log)
-               log = "";
+               log = ∅
        if (*uuid && *url) {
                snprintf(gitsvnline, MAX_GITSVN_LINE_LEN,
                                "\n\ngit-svn-id: %s@%"PRIu32" %s\n",
@@ -49,9 +51,10 @@ void fast_export_commit(uint32_t revision, const char *author, char *log,
                   *author ? author : "nobody",
                   *author ? author : "nobody",
                   *uuid ? uuid : "local", timestamp);
-       printf("data %"PRIu32"\n%s%s\n",
-                  (uint32_t) (strlen(log) + strlen(gitsvnline)),
-                  log, gitsvnline);
+       printf("data %"PRIuMAX"\n",
+               (uintmax_t) (log->len + strlen(gitsvnline)));
+       fwrite(log->buf, log->len, 1, stdout);
+       printf("%s\n", gitsvnline);
        if (!first_commit_done) {
                if (revision > 1)
                        printf("from refs/heads/master^0\n");