Factor out code for updating notes branches to NotesBranchUtil.
The CreateCodeReviewNotes and BanCommit classes both need the same functionality of updating a notes branch and automatic merge of note trees. The code was repeated in both classes with slight variations. The same functionality will probably be needed as soon as we introduce yet another special purpose notes branch. Change-Id: If2fc17cd795585a9f90bb0bf82695db9bd04392c Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
This commit is contained in:
@@ -22,6 +22,7 @@ import com.google.gerrit.server.project.ProjectControl;
|
||||
import com.google.gerrit.sshd.SshCommand;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import org.eclipse.jgit.api.errors.ConcurrentRefUpdateException;
|
||||
import org.eclipse.jgit.lib.ObjectId;
|
||||
import org.kohsuke.args4j.Argument;
|
||||
import org.kohsuke.args4j.Option;
|
||||
@@ -80,6 +81,8 @@ public class BanCommitCommand extends SshCommand {
|
||||
throw die(e);
|
||||
} catch (InterruptedException e) {
|
||||
throw die(e);
|
||||
} catch (ConcurrentRefUpdateException e) {
|
||||
throw die(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user