Selaa lähdekoodia

CreateBranchCommand: Wrong existence check

Bug: 337044
Change-Id: I89224719712c1f1ab80ea34280139dfeb00be3d0
Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
tags/v0.11.3
Mathias Kinzler 13 vuotta sitten
vanhempi
commit
c893b1f75f

+ 3
- 1
org.eclipse.jgit/src/org/eclipse/jgit/api/CreateBranchCommand.java Näytä tiedosto

checkCallable(); checkCallable();
processOptions(); processOptions();
try { try {
boolean exists = repo.getRef(name) != null;
Ref refToCheck = repo.getRef(name);
boolean exists = refToCheck != null
&& refToCheck.getName().startsWith(Constants.R_HEADS);
if (!force && exists) if (!force && exists)
throw new RefAlreadyExistsException(MessageFormat.format( throw new RefAlreadyExistsException(MessageFormat.format(
JGitText.get().refAlreadExists, name)); JGitText.get().refAlreadExists, name));

Loading…
Peruuta
Tallenna