Skip to content

Commit

Permalink
force exclusion of .git directory from processing
Browse files Browse the repository at this point in the history
  • Loading branch information
mjfitzpatrick authored and olebole committed Jan 28, 2024
1 parent 81fde24 commit 228cc51
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions unix/boot/rmbin/rmbin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 7 additions & 0 deletions unix/boot/rmfiles/rmfiles.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 228cc51

Please # to comment.