Browse Source

[findBugs] Don't pass null for non-null parameter in RebaseCommand

Change-Id: Iee4d50aa9c6b75f9906d2c51a940ddc90a944192
stable-2.2
Matthias Sohn 12 years ago committed by Gerrit Code Review @ Eclipse.org
parent
commit
8d062dec0c
  1. 1
      org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
  2. 6
      org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java
  3. 1
      org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java

1
org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties

@ -1,6 +1,7 @@
abbreviationLengthMustBeNonNegative=Abbreviation length must not be negative. abbreviationLengthMustBeNonNegative=Abbreviation length must not be negative.
abortingRebase=Aborting rebase: resetting to {0} abortingRebase=Aborting rebase: resetting to {0}
abortingRebaseFailed=Could not abort rebase abortingRebaseFailed=Could not abort rebase
abortingRebaseFailedNoOrigHead=Could not abort rebase since ORIG_HEAD is null
advertisementCameBefore=advertisement of {0}^{} came before {1} advertisementCameBefore=advertisement of {0}^{} came before {1}
advertisementOfCameBefore=advertisement of {0}^{} came before {1} advertisementOfCameBefore=advertisement of {0}^{} came before {1}
amazonS3ActionFailed={0} of ''{1}'' failed: {2} {3} amazonS3ActionFailed={0} of ''{1}'' failed: {2} {3}

6
org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java

@ -822,7 +822,11 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
ProgressMonitor.UNKNOWN); ProgressMonitor.UNKNOWN);
DirCacheCheckout dco; DirCacheCheckout dco;
RevCommit commit = walk.parseCommit(repo.resolve(commitId)); if (commitId == null)
throw new JGitInternalException(
JGitText.get().abortingRebaseFailedNoOrigHead);
ObjectId id = repo.resolve(commitId);
RevCommit commit = walk.parseCommit(id);
if (result.getStatus().equals(Status.FAILED)) { if (result.getStatus().equals(Status.FAILED)) {
RevCommit head = walk.parseCommit(repo.resolve(Constants.HEAD)); RevCommit head = walk.parseCommit(repo.resolve(Constants.HEAD));
dco = new DirCacheCheckout(repo, head.getTree(), dco = new DirCacheCheckout(repo, head.getTree(),

1
org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java

@ -62,6 +62,7 @@ public class JGitText extends TranslationBundle {
/***/ public String abbreviationLengthMustBeNonNegative; /***/ public String abbreviationLengthMustBeNonNegative;
/***/ public String abortingRebase; /***/ public String abortingRebase;
/***/ public String abortingRebaseFailed; /***/ public String abortingRebaseFailed;
/***/ public String abortingRebaseFailedNoOrigHead;
/***/ public String advertisementCameBefore; /***/ public String advertisementCameBefore;
/***/ public String advertisementOfCameBefore; /***/ public String advertisementOfCameBefore;
/***/ public String amazonS3ActionFailed; /***/ public String amazonS3ActionFailed;

Loading…
Cancel
Save