diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2022-09-21 00:40:23 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-20 12:40:23 -0400 |
commit | 937ef6fa906cd6ea28e181cfa92bacf409a75f69 (patch) | |
tree | 0eda86e95578bd335aa09c4c837a3251bc329843 | |
parent | 54d4e664c2b78213f2e55e3ba972032f82898c83 (diff) | |
download | gitea-937ef6fa906cd6ea28e181cfa92bacf409a75f69.tar.gz gitea-937ef6fa906cd6ea28e181cfa92bacf409a75f69.zip |
Treat git object mode 40755 as directory (#21195) (#21218)
Backport #21195
Git uses 040000 for tree object, but some users may get 040755 for
unknown reasons, fix #21190
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
-rw-r--r-- | modules/git/parse_nogogit.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/git/parse_nogogit.go b/modules/git/parse_nogogit.go index 6dc4900992..c8f0f994fc 100644 --- a/modules/git/parse_nogogit.go +++ b/modules/git/parse_nogogit.go @@ -44,7 +44,7 @@ func parseTreeEntries(data []byte, ptree *Tree) ([]*TreeEntry, error) { case "160000": entry.entryMode = EntryModeCommit pos += 14 // skip over "160000 object " - case "040000": + case "040000", "040755": // git uses 040000 for tree object, but some users may get 040755 for unknown reasons entry.entryMode = EntryModeTree pos += 12 // skip over "040000 tree " default: @@ -119,7 +119,7 @@ loop: entry.entryMode = EntryModeSymlink case "160000": entry.entryMode = EntryModeCommit - case "40000": + case "40000", "40755": // git uses 40000 for tree object, but some users may get 40755 for unknown reasons entry.entryMode = EntryModeTree default: log.Debug("Unknown mode: %v", string(mode)) |