Skip deleted files from symlink check

pull/3199/head
Philip Laine 3 years ago
parent 5691a444f1
commit b65ef33936

@ -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…
Cancel
Save