Skip to contentSkip to conversation

Correct fast-export file mode strings to match fast-import standard

PATCH In review Shawn O. Pearce 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Correct fast-export file mode strings to match fast-import standard

The fast-import file format does not expect leading '0' in front of a file mode; that is we want '100644' and '0100644'.

Thanks to Ian Clatworthy of the Bazaar project for noticing the difference in output/input.

---
 builtin-fast-export.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
builtin-fast-export.c +1 -1
index 49b54de..e1c5630 100755
@@ -123,7 +123,7 @@ static void show_filemodify(struct diff_queue_struct *q,
 			printf("D %s\n", spec->path);
 		else {
 			struct object *object = lookup_object(spec->sha1);
-			printf("M 0%06o :%d %s\n", spec->mode,
+			printf("M %06o :%d %s\n", spec->mode,
 			       get_object_mark(object), spec->path);
 		}
 	}
Signature · 1 line
1.5.4.3.295.g6b554
#1 lore raw

Hi,

Quoted 2 lines · Shawn O. Pearce

The fast-import file format does not expect leading '0' in front of a file mode; that is we want '100644' and '0100644'.

s/and/& not/

builtin-fast-export.c static void show_filemodify(struct diff_queue_struct *q, · line 126

Quoted 2 lines
builtin-fast-export.c +1 -1
-			printf("M 0%06o :%d %s\n", spec->mode,
+			printf("M %06o :%d %s\n", spec->mode,

Definitely embarassing.

Thanks,
Dscho