Fix 'git fetch --prune' deleting all remote refs.

Before Git 1.7.7.2 'git fetch --prune origin master' used to remove all remote references.
This was fixed in 1.7.7.2.
For the sake of simplicity we are not going to call '--prune' for the older Gits.

Other way would be to call 'git remote prune origin' for older Gits,
but this auto-prune feature doesn't seem to be important enough for such effort.
This commit is contained in:
Kirill Likhodedov
2012-03-10 16:14:55 +04:00
parent 753b3ced72
commit da06fb2951
@@ -73,10 +73,15 @@ public enum GitVersionSpecialty {
}
},
/**
* {@code git fetch --prune} is actually supported since 1.7.0,
* but before 1.7.7.2 calling {@code git fetch --prune origin master} would delete all other references.
* This was fixed in {@code ed43de6ec35dfd4c4bd33ae9b5f2ebe38282209f} and added to the Git 1.7.7.2 release.
*/
SUPPORTS_FETCH_PRUNE {
@Override
public boolean existsIn(@NotNull GitVersion version) {
return version.isLaterOrEqual(new GitVersion(1, 7, 0, 0));
return version.isLaterOrEqual(new GitVersion(1, 7, 7, 2));
}
},