1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-12 23:41:54 +03:00

Allow adding a file to the .git/info/exclude file

This commit is contained in:
Juan Sanchez Montalvo
2022-06-24 22:10:13 +01:00
committed by Jesse Duffield
parent 41071c3703
commit 11d766053e
40 changed files with 240 additions and 57 deletions

View File

@ -218,6 +218,11 @@ func (self *WorkingTreeCommands) Ignore(filename string) error {
return self.os.AppendLineToFile(".gitignore", filename)
}
// Exclude adds a file to the .git/info/exclude for the repo
func (self *WorkingTreeCommands) Exclude(filename string) error {
return self.os.AppendLineToFile(".git/info/exclude", filename)
}
// WorktreeFileDiff returns the diff of a file
func (self *WorkingTreeCommands) WorktreeFileDiff(file *models.File, plain bool, cached bool, ignoreWhitespace bool) string {
// for now we assume an error means the file was deleted