In sftp directories were not being deleted. Since git does not keep track of directories the script needs to check to see if the parent directory is empty after a file deletion and then delete the directory if it's empty. For ftp there was already a function to do this, so I took the logic from that function and rewrote it to work for sftp.
In sftp directories were not being deleted. Since git does not keep track of directories the script needs to check to see if the parent directory is empty after a file deletion and then delete the directory if it's empty. For ftp there was already a function to do this, so I took the logic from that function and rewrote it to work for sftp.