Hi List!

When importing a git fast import file, the master branch is silently
changed to trunk, to match the fossil default.
However, when exported back out the reverse conversion does not apply.

This is not good, because fossil is effectively re-writing history.
But what is worse is that the export does not match the import .... I'm
striving to get out pretty much exactly what I put in.

Patch attached to fix this.

Roy
Index: src/export.c
==================================================================
--- src/export.c
+++ src/export.c
@@ -611,11 +611,12 @@
 
     bag_insert(&vers, ckinId);
     db_bind_int(&q2, ":rid", ckinId);
     db_step(&q2);
     db_reset(&q2);
-    if( zBranch==0 ) zBranch = "trunk";
+    /* fossil trunk is git master. */
+    if( zBranch==0 || fossil_strcmp(zBranch, "trunk") == 0 ) zBranch = 
"master";
     zMark = mark_name_from_rid(ckinId, &unused_mark);
     printf("commit refs/heads/");
     print_ref(zBranch);
     printf("\nmark %s\n", zMark);
     free(zMark);

_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to