Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  tar-tree: file/dirmode fix.
  • Loading branch information
Junio C Hamano committed Mar 4, 2006
2 parents ce4c8b2 + 473d404 commit be97292
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tar-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,11 @@ static void write_header(const unsigned char *sha1, char typeflag, const char *b
}

if (S_ISDIR(mode))
mode |= 0755; /* GIT doesn't store permissions of dirs */
if (S_ISLNK(mode))
mode |= 0777; /* ... nor of symlinks */
mode |= 0777;
else if (S_ISREG(mode))
mode |= (mode & 0100) ? 0777 : 0666;
else if (S_ISLNK(mode))
mode |= 0777;
sprintf(&header[100], "%07o", mode & 07777);

/* XXX: should we provide more meaningful info here? */
Expand Down Expand Up @@ -391,7 +393,7 @@ int main(int argc, char **argv)
usage(tar_tree_usage);
}

commit = lookup_commit_reference(sha1);
commit = lookup_commit_reference_gently(sha1, 1);
if (commit) {
write_global_extended_header(commit->object.sha1);
archive_time = commit->date;
Expand Down

0 comments on commit be97292

Please sign in to comment.