forked from forgejo/forgejo
Backport #26352 Now, you don't need to be a git expert anymore to know what these numbers mean. ## Before  ## After  or when the mode actually changed:  (cherry picked from commit39cbca0f95
)
This commit is contained in:
parent
678c611c3d
commit
64e2c8f6ff
3 changed files with 30 additions and 2 deletions
|
@ -427,6 +427,23 @@ func (diffFile *DiffFile) ShouldBeHidden() bool {
|
|||
return diffFile.IsGenerated || diffFile.IsViewed
|
||||
}
|
||||
|
||||
func (diffFile *DiffFile) ModeTranslationKey(mode string) string {
|
||||
switch mode {
|
||||
case "040000":
|
||||
return "git.filemode.directory"
|
||||
case "100644":
|
||||
return "git.filemode.normal_file"
|
||||
case "100755":
|
||||
return "git.filemode.executable_file"
|
||||
case "120000":
|
||||
return "git.filemode.symbolic_link"
|
||||
case "160000":
|
||||
return "git.filemode.submodule"
|
||||
default:
|
||||
return mode
|
||||
}
|
||||
}
|
||||
|
||||
func getCommitFileLineCount(commit *git.Commit, filePath string) int {
|
||||
blob, err := commit.GetBlobByPath(filePath)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue