Class BanCommit


  • public class BanCommit
    extends Object
    Logic for banning commits from being uploaded.

    Gerrit has a per-project list of commits that are forbidden to be pushed. This class reads and writes the banned commits list in refs/meta/reject-commits.

    • Method Detail

      • loadRejectCommitsMap

        public static org.eclipse.jgit.notes.NoteMap loadRejectCommitsMap​(org.eclipse.jgit.lib.Repository repo,
                                                                          org.eclipse.jgit.revwalk.RevWalk walk)
                                                                   throws IOException
        Loads a list of commits to reject from refs/meta/reject-commits.
        Parameters:
        repo - repository from which the rejected commits should be loaded
        walk - open revwalk on repo.
        Returns:
        NoteMap of commits to be rejected, null if there are none.
        Throws:
        IOException - the map cannot be loaded.