stgit/ Handle a reset that changes files to directories

If reset() takes us from a tree where some path is a file to one
where it is a directory, then checkout() will replace the file
with the directory, and we don't want to try to os.remove() the
path (which would throw an exception because we're trying to
remove a directory.) This fixes bug

Signed-off-by: Peter Maydell <>
Signed-off-by: Catalin Marinas <>
1 file changed