Skip to content

Commit

Permalink
Merge pull request #362 from olebole/noirlab-rmbin
Browse files Browse the repository at this point in the history
NOIRLAB: Force exclusion of .git directory from processing in rmbin and rmfiles
  • Loading branch information
olebole committed Jan 28, 2024
2 parents 81fde24 + 228cc51 commit b1422a1
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 b1422a1

Please sign in to comment.