|
|
|
@ -167,6 +167,17 @@ public abstract class RefUpdate {
|
|
|
|
|
|
|
|
|
|
private final Ref ref; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Is this RefUpdate detaching a symbolic ref? |
|
|
|
|
* |
|
|
|
|
* We need this info since this.ref will normally be peeled of in case of |
|
|
|
|
* detaching a symbolic ref (HEAD for example). |
|
|
|
|
* |
|
|
|
|
* Without this flag we cannot decide whether the ref has to be updated or |
|
|
|
|
* not in case when it was a symbolic ref and the newValue == oldValue. |
|
|
|
|
*/ |
|
|
|
|
private boolean detachingSymbolicRef; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Construct a new update operation for the reference. |
|
|
|
|
* <p> |
|
|
|
@ -253,6 +264,13 @@ public abstract class RefUpdate {
|
|
|
|
|
return newValue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Tells this RefUpdate that it is actually detaching a symbolic ref. |
|
|
|
|
*/ |
|
|
|
|
public void setDetachingSymbolicRef() { |
|
|
|
|
detachingSymbolicRef = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Set the new value the ref will update to. |
|
|
|
|
* |
|
|
|
@ -596,7 +614,7 @@ public abstract class RefUpdate {
|
|
|
|
|
|
|
|
|
|
newObj = safeParse(walk, newValue); |
|
|
|
|
oldObj = safeParse(walk, oldValue); |
|
|
|
|
if (newObj == oldObj) |
|
|
|
|
if (newObj == oldObj && !detachingSymbolicRef) |
|
|
|
|
return store.execute(Result.NO_CHANGE); |
|
|
|
|
|
|
|
|
|
if (newObj instanceof RevCommit && oldObj instanceof RevCommit) { |
|
|
|
|