git-p4: Unset P4DIFF environment variable when using 'p4 -du diff'
[gitweb.git] / builtin-fast-export.c
index f741df522014b9495f18cf13c2e01382da71c41d..e1c56303e5cb7882bc79980c4f8e6c6791ad323b 100755 (executable)
@@ -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);
                }
        }
@@ -196,8 +196,7 @@ static void handle_commit(struct commit *commit, struct rev_info *rev)
                          ? strlen(reencoded) : message
                          ? strlen(message) : 0),
               reencoded ? reencoded : message ? message : "");
-       if (reencoded)
-               free(reencoded);
+       free(reencoded);
 
        for (i = 0, p = commit->parents; p; p = p->next) {
                int mark = get_object_mark(&p->item->object);