1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-19 23:03:53 -04:00

remove unused variable and make sure to check that the current

generation is not the one we are deleting
This commit is contained in:
Matthew O'Gorman 2018-03-01 22:22:02 -05:00
parent 12fe2249e1
commit 3c16044cb0

View file

@ -159,7 +159,6 @@ void deleteGenerations(const Path & profile, const std::set<unsigned int> & gens
void deleteGenerationsGreaterThan(const Path & profile, int max, bool dryRun) void deleteGenerationsGreaterThan(const Path & profile, int max, bool dryRun)
{ {
int max_keep = 0;
PathLocks lock; PathLocks lock;
lockProfile(lock, profile); lockProfile(lock, profile);
@ -172,7 +171,8 @@ void deleteGenerationsGreaterThan(const Path & profile, int max, bool dryRun)
max--; max--;
continue; continue;
} }
deleteGeneration2(profile, i->number, dryRun); if (i->number != curGen)
deleteGeneration2(profile, i->number, dryRun);
} }
} }