Skip to content

Commit

Permalink
Delete a left-over trash directory before doing a GC
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Jan 4, 2013
1 parent 92926be commit e42df68
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/libstore/gc.cc
Expand Up @@ -659,7 +659,10 @@ void LocalStore::collectGarbage(const GCOptions & options, GCResults & results)
increase, since we hold locks on everything. So everything
that is not reachable from `roots'. */

if (state.shouldDelete) createDirs(state.trashDir);
if (state.shouldDelete) {
if (pathExists(state.trashDir)) deleteGarbage(state, state.trashDir);
createDirs(state.trashDir);
}

/* Now either delete all garbage paths, or just the specified
paths (for gcDeleteSpecific). */
Expand Down

0 comments on commit e42df68

Please sign in to comment.