mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-22 07:31:47 +00:00
Skip deleted files from symlink check
This commit is contained in:
parent
5691a444f1
commit
b65ef33936
1 changed files with 7 additions and 1 deletions
|
|
@ -172,7 +172,13 @@ func (g *GoGit) Commit(message git.Commit, opts ...git.Option) (string, error) {
|
|||
// modified. There's no circumstance in which we want to commit a
|
||||
// change to a broken symlink: so, detect and skip those.
|
||||
var changed bool
|
||||
for file, _ := range status {
|
||||
for file, fileStatus := range status {
|
||||
if fileStatus.Staging == gogit.Deleted {
|
||||
_, _ = wt.Add(file)
|
||||
changed = true
|
||||
continue
|
||||
}
|
||||
|
||||
abspath := filepath.Join(g.path, file)
|
||||
info, err := os.Lstat(abspath)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue