Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

worktree.AddWithOptions not staging deleted files #223

Closed
boindil opened this issue Dec 8, 2020 · 2 comments
Closed

worktree.AddWithOptions not staging deleted files #223

boindil opened this issue Dec 8, 2020 · 2 comments

Comments

@boindil
Copy link

boindil commented Dec 8, 2020

According to docs this should also stage deleted files, but sadly it does not.

err := worktree.AddWithOptions(&git.AddOptions{
	All: true,
})
// AddOptions describes how a add operation should be performed
type AddOptions struct {
	// All equivalent to `git add -A`, update the index not only where the
	// working tree has a file matching `Path` but also where the index already
	// has an entry. This adds, modifies, and removes index entries to match the
	// working tree.  If no `Path` nor `Glob` is given when `All` option is
	// used, all files in the entire working tree are updated.
	All bool
	// Path is the exact filepath to a the file or directory to be added.
	Path string
	// Glob adds all paths, matching pattern, to the index. If pattern matches a
	// directory path, all directory contents are added to the index recursively.
	Glob string
}
@DataHearth
Copy link

DataHearth commented Jun 27, 2022

Is there any update on this issue ? We still encounter the problem with the latest version.

A workaround has been given here but I can't tell for now if it works.

@boindil
Copy link
Author

boindil commented Jun 29, 2022

@DataHearth I'm not exactly sure, bis the linked workaround seems pretty similar to what I remember implementing as a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants