diff --git a/dist/index.js b/dist/index.js
index 0306d5d..b96c86c 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -4981,7 +4981,7 @@ function getSource(settings) {
             // Delete the contents of the directory. Don't delete the directory itself
             // since it may be the current working directory.
             for (const file of yield fs.promises.readdir(settings.repositoryPath)) {
-                yield io.rmRF(settings.repositoryPath);
+                yield io.rmRF(path.join(settings.repositoryPath, file));
             }
         }
         // Initialize the repository
diff --git a/src/git-source-provider.ts b/src/git-source-provider.ts
index 432d93c..122bbe1 100644
--- a/src/git-source-provider.ts
+++ b/src/git-source-provider.ts
@@ -62,7 +62,7 @@ export async function getSource(settings: ISourceSettings): Promise<void> {
     // Delete the contents of the directory. Don't delete the directory itself
     // since it may be the current working directory.
     for (const file of await fs.promises.readdir(settings.repositoryPath)) {
-      await io.rmRF(settings.repositoryPath)
+      await io.rmRF(path.join(settings.repositoryPath, file))
     }
   }