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: 
Showing the changes to services/gitdiff/gitdiff.go (1 of 3 files). Show all
Unified · Split
| @@ -427,6 +427,23 @@ func (diffFile *DiffFile) ShouldBeHidden() bool { · 426 unmodified lines | ||
| 427 | 427 | return diffFile.IsGenerated || diffFile.IsViewed |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | +func (diffFile *DiffFile) ModeTranslationKey(mode string) string { | |
| 431 | + switch mode { | |
| 432 | + case "040000": | |
| 433 | + return "git.filemode.directory" | |
| 434 | + case "100644": | |
| 435 | + return "git.filemode.normal_file" | |
| 436 | + case "100755": | |
| 437 | + return "git.filemode.executable_file" | |
| 438 | + case "120000": | |
| 439 | + return "git.filemode.symbolic_link" | |
| 440 | + case "160000": | |
| 441 | + return "git.filemode.submodule" | |
| 442 | + default: | |
| 443 | + return mode | |
| 444 | + } | |
| 445 | +} | |
| 446 | + | |
| 430 | 447 | func getCommitFileLineCount(commit *git.Commit, filePath string) int { |
| 431 | 448 | blob, err := commit.GetBlobByPath(filePath) |
| 432 | 449 | if err != nil { |