Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Worktree if support add deleted files #1268

Description

@magicalcosmos

Hi there,

I removed files by os.RemoveAll and then add, but that's didn't work, the code as belows:

//remove local files
os.RemoveAll(path) 

// add files, prepare commit and push
repo, err := git.PlainOpen(repository)
if err != nil {
	log.Logger.Debug("fail to init repository", zap.Error(err))
	return err
}
wt, _:= repo.Worktree()
_, err = wt.Add(".")
if err != nil {
	return err
}

What's wrong with that code, any suggestions?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions