fix: Pass /dev/null to diff command for missing files in apply --interactive
This commit is contained in:
1 parent
ee28f348f2
commit
4e184024be
5 files changed
+38
-8
No files matched your search
@@ -1197,9 +1197,13 @@ func (c *Config) defaultPreApplyFunc(
|
||||
case err != nil:
|
||||
return err
|
||||
case choice == "diff":
|
||||
destAbsPath := c.DestDirAbsPath.Join(targetRelPath)
|
||||
if actualEntryState.Type == chezmoi.EntryStateTypeRemove {
|
||||
destAbsPath = chezmoi.DevNullAbsPath
|
||||
}
|
||||
if err := c.diffFile(
|
||||
targetRelPath,
|
||||
c.DestDirAbsPath.Join(targetRelPath), actualContents, actualEntryState.Mode,
|
||||
destAbsPath, actualContents, actualEntryState.Mode,
|
||||
chezmoi.EmptyAbsPath, targetContents, targetEntryState.Mode,
|
||||
); err != nil {
|
||||
return err
|
||||
|
||||
Reference in new issue
Block a user