mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-02-09 13:47:11 +02:00
show error on git add --patching untracked file
This commit is contained in:
parent
5d9df3ca07
commit
0c84055abd
@ -74,6 +74,9 @@ func handleAddPatch(g *gocui.Gui, v *gocui.View) error {
|
||||
if !file.HasUnstagedChanges {
|
||||
return createErrorPanel(g, "File has no unstaged changes to add")
|
||||
}
|
||||
if !file.Tracked {
|
||||
return createErrorPanel(g, "Cannot git add --patch untracked files")
|
||||
}
|
||||
gitAddPatch(g, file.Name)
|
||||
return err
|
||||
}
|
||||
|
@ -306,7 +306,7 @@ func getOpenCommand() (string, string, error) {
|
||||
}
|
||||
|
||||
func gitAddPatch(g *gocui.Gui, filename string) {
|
||||
runSubProcess(g, "git", "add", "-p", filename)
|
||||
runSubProcess(g, "git", "add", "--patch", filename)
|
||||
}
|
||||
|
||||
func editFile(g *gocui.Gui, filename string) (string, error) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user