From 595416f30774ab79764cd65d1a4a86cbbb78c1f2 Mon Sep 17 00:00:00 2001 From: Mike Fitzpatrick Date: Fri, 15 Sep 2023 18:52:17 -0700 Subject: [PATCH] force exclusion of .git directory from processing --- unix/boot/rmbin/rmbin.c | 7 +++++++ unix/boot/rmfiles/rmfiles.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/unix/boot/rmbin/rmbin.c b/unix/boot/rmbin/rmbin.c index 760a1fb35..a79968726 100644 --- a/unix/boot/rmbin/rmbin.c +++ b/unix/boot/rmbin/rmbin.c @@ -134,6 +134,13 @@ rmbin ( char fname[SZ_PATHNAME+1]; int dp, ftype; + + /* Hardwire an exclusion for a .git directory so we don't + * unintentially delete the repo files. + */ + if (strncmp (".git", dir, 4) == 0) + return; + if ((dp = os_diropen (dir)) == ERR) { fprintf (stderr, "cannot open directory `%s'\n", dir); fflush (stderr); diff --git a/unix/boot/rmfiles/rmfiles.c b/unix/boot/rmfiles/rmfiles.c index a1c3ac0e5..533aaee78 100644 --- a/unix/boot/rmfiles/rmfiles.c +++ b/unix/boot/rmfiles/rmfiles.c @@ -134,6 +134,13 @@ rmfiles ( int nextn, mode; FILE *fp = NULL; + + /* Hardwire an exclusion for a .git directory so we don't + * unintentially delete the repo files. + */ + if (strncmp (".git", dir, 4) == 0) + return; + if (debug) { fprintf (stderr, "rmfiles @(%s), exe=%d, ver=%d\n", prog, execute, verbose);