diff --git a/fast-import.c b/fast-import.c index d58cca58e5..6d5ee6f463 100644 --- a/fast-import.c +++ b/fast-import.c @@ -1868,12 +1868,13 @@ static void file_change_m(struct branch *b) if (!p) die("Corrupt mode: %s", command_buf.buf); switch (mode) { + case 0644: + case 0755: + mode |= S_IFREG; case S_IFREG | 0644: case S_IFREG | 0755: case S_IFLNK: case S_IFGITLINK: - case 0644: - case 0755: /* ok */ break; default: @@ -1940,7 +1941,7 @@ static void file_change_m(struct branch *b) typename(type), command_buf.buf); } - tree_content_set(&b->branch_tree, p, sha1, S_IFREG | mode, NULL); + tree_content_set(&b->branch_tree, p, sha1, mode, NULL); } static void file_change_d(struct branch *b)