diff --git a/cmd/flux/bootstrap_bitbucket_server.go b/cmd/flux/bootstrap_bitbucket_server.go index 9279994e..af93f8f0 100644 --- a/cmd/flux/bootstrap_bitbucket_server.go +++ b/cmd/flux/bootstrap_bitbucket_server.go @@ -22,7 +22,6 @@ import ( "os" "time" - "github.com/ProtonMail/go-crypto/openpgp" "github.com/go-git/go-git/v5/plumbing/transport/http" "github.com/spf13/cobra" diff --git a/cmd/flux/bootstrap_git.go b/cmd/flux/bootstrap_git.go index b7a250f1..8d975749 100644 --- a/cmd/flux/bootstrap_git.go +++ b/cmd/flux/bootstrap_git.go @@ -24,7 +24,6 @@ import ( "strings" "time" - "github.com/ProtonMail/go-crypto/openpgp" "github.com/go-git/go-git/v5/plumbing/transport" "github.com/go-git/go-git/v5/plumbing/transport/http" "github.com/go-git/go-git/v5/plumbing/transport/ssh" diff --git a/cmd/flux/bootstrap_github.go b/cmd/flux/bootstrap_github.go index a2459437..34ad8e2f 100644 --- a/cmd/flux/bootstrap_github.go +++ b/cmd/flux/bootstrap_github.go @@ -22,7 +22,6 @@ import ( "os" "time" - "github.com/ProtonMail/go-crypto/openpgp" "github.com/go-git/go-git/v5/plumbing/transport/http" "github.com/spf13/cobra" diff --git a/cmd/flux/bootstrap_gitlab.go b/cmd/flux/bootstrap_gitlab.go index e6c94f6e..cb38cdae 100644 --- a/cmd/flux/bootstrap_gitlab.go +++ b/cmd/flux/bootstrap_gitlab.go @@ -24,7 +24,6 @@ import ( "strings" "time" - "github.com/ProtonMail/go-crypto/openpgp" "github.com/go-git/go-git/v5/plumbing/transport/http" "github.com/spf13/cobra" diff --git a/pkg/bootstrap/git/gogit/gogit.go b/pkg/bootstrap/git/gogit/gogit.go index c1c6200a..324e8f02 100644 --- a/pkg/bootstrap/git/gogit/gogit.go +++ b/pkg/bootstrap/git/gogit/gogit.go @@ -160,7 +160,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.Worktree == gogit.Deleted { + _, _ = wt.Add(file) + changed = true + continue + } + abspath := filepath.Join(g.path, file) info, err := os.Lstat(abspath) if err != nil {