Skip to content

Commit

Permalink
Check correct parent for git
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt committed Nov 18, 2024
1 parent 9f14248 commit 34f3639
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static void run(GitHub gh, GHPullRequest pr, Configuration.PRActions acti
for (String del : deleted) {
var path = dir.resolve(del);
if (checkSafe(dir, path)) {
Files.deleteIfExists(path);
Files.delete(path);
}
}

Expand Down Expand Up @@ -93,7 +93,7 @@ public static void run(GitHub gh, GHPullRequest pr, Configuration.PRActions acti
private static boolean checkSafe(Path dir, Path path) {
var parent = path;
while ((parent = parent.getParent()) != null) {
if (dir.getFileName().toString().equals(".git")) return false;
if (parent.getFileName().toString().equals(".git")) return false;
if (dir.equals(parent)) return true;
}
return false;
Expand Down

0 comments on commit 34f3639

Please sign in to comment.