diff options
author | Paul Martin <paul@paulsputer.com> | 2016-04-03 20:30:22 +0100 |
---|---|---|
committer | Paul Martin <paul@paulsputer.com> | 2016-04-06 19:46:58 +0100 |
commit | cd7e4f9186f2ace4416780a7dd6341e01e23a45f (patch) | |
tree | 0cf2f54fa939379d6fd91b5efe29c05aacc4486f /src/main/java/com/gitblit/utils | |
parent | b00f45e9492d1cc17bc214daab9988c640741621 (diff) | |
download | gitblit-cd7e4f9186f2ace4416780a7dd6341e01e23a45f.tar.gz gitblit-cd7e4f9186f2ace4416780a7dd6341e01e23a45f.zip |
Fix for #962 - Delete patchset ability
Diffstat (limited to 'src/main/java/com/gitblit/utils')
-rw-r--r-- | src/main/java/com/gitblit/utils/JGitUtils.java | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/main/java/com/gitblit/utils/JGitUtils.java b/src/main/java/com/gitblit/utils/JGitUtils.java index 90d40020..adcbb4de 100644 --- a/src/main/java/com/gitblit/utils/JGitUtils.java +++ b/src/main/java/com/gitblit/utils/JGitUtils.java @@ -1745,13 +1745,9 @@ public class JGitUtils { * @return true if successful
*/
public static boolean deleteBranchRef(Repository repository, String branch) {
- String branchName = branch;
- if (!branchName.startsWith(Constants.R_HEADS)) {
- branchName = Constants.R_HEADS + branch;
- }
try {
- RefUpdate refUpdate = repository.updateRef(branchName, false);
+ RefUpdate refUpdate = repository.updateRef(branch, false);
refUpdate.setForceUpdate(true);
RefUpdate.Result result = refUpdate.delete();
switch (result) {
@@ -1762,10 +1758,10 @@ public class JGitUtils { return true;
default:
LOGGER.error(MessageFormat.format("{0} failed to delete to {1} returned result {2}",
- repository.getDirectory().getAbsolutePath(), branchName, result));
+ repository.getDirectory().getAbsolutePath(), branch, result));
}
} catch (Throwable t) {
- error(t, repository, "{0} failed to delete {1}", branchName);
+ error(t, repository, "{0} failed to delete {1}", branch);
}
return false;
}
|