You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The shell script handles the commit from the stash for untracked files (if present) by calling git checkout-index --all which according to the documentation does not overwriting existing files (since -f is not passed).
I'm therefore assuming that git checkout-index --all is not touching the index at all and not modifying any files nor deleting any files from the work tree, but only adding new files.
How do you reproduce this behavior using git_checkout_tree()? If you pass GIT_CHECKOUT_SAFE_CREATE | GIT_CHECKOUT_DONT_UPDATE_INDEX, it will still update and delete files in the worktree (which is bad since the tree for the untracked commit in the stash only contains the untracked files and nothing else).
The text was updated successfully, but these errors were encountered:
Sorry for the delay. In making a pass through bug reports, I think that this does exist, my reading of checkout options suggests that GIT_CHECKOUT_DONT_REMOVE_EXISTING will prevent existing files from being removed (either to delete them because they don't exist anymore or to rewrite them.
Please reopen if this is incorrect and this is an option that you require.
I'm working on a proper implementation of
git stash apply
(see #2636) based on the shell script implementation in Git (see https://github.com/git/git/blob/master/git-stash.sh#L440).The shell script handles the commit from the stash for untracked files (if present) by calling
git checkout-index --all
which according to the documentation does not overwriting existing files (since-f
is not passed).I'm therefore assuming that
git checkout-index --all
is not touching the index at all and not modifying any files nor deleting any files from the work tree, but only adding new files.How do you reproduce this behavior using
git_checkout_tree()
? If you passGIT_CHECKOUT_SAFE_CREATE | GIT_CHECKOUT_DONT_UPDATE_INDEX
, it will still update and delete files in the worktree (which is bad since the tree for the untracked commit in the stash only contains the untracked files and nothing else).The text was updated successfully, but these errors were encountered: