Procházet zdrojové kódy

Add commit id and parent count to exception message

Bug: 357312
Change-Id: I2f85cf88650594eca7df6aa0e26bea329674f08e
tags/v1.3.0.201202121842-rc4
Kevin Sawicki před 12 roky
rodič
revize
3c7dceec1a

+ 1
- 1
org.eclipse.jgit/resources/org/eclipse/jgit/JGitText.properties Zobrazit soubor

cannotStoreObjects=cannot store objects cannotStoreObjects=cannot store objects
cannotUnloadAModifiedTree=Cannot unload a modified tree. cannotUnloadAModifiedTree=Cannot unload a modified tree.
cannotWorkWithOtherStagesThanZeroRightNow=Cannot work with other stages than zero right now. Won't write corrupt index. cannotWorkWithOtherStagesThanZeroRightNow=Cannot work with other stages than zero right now. Won't write corrupt index.
canOnlyCherryPickCommitsWithOneParent=Can only cherry-pick commits which have exactly one parent
canOnlyCherryPickCommitsWithOneParent=Cannot cherry-pick commit ''{0}'' because it has {1} parents, only commits with exactly one parent are supported.
canOnlyRevertCommitsWithOneParent=Can only revert commits which have exactly one parent canOnlyRevertCommitsWithOneParent=Can only revert commits which have exactly one parent
cantFindObjectInReversePackIndexForTheSpecifiedOffset=Can't find object in (reverse) pack index for the specified offset {0} cantFindObjectInReversePackIndexForTheSpecifiedOffset=Can't find object in (reverse) pack index for the specified offset {0}
cantPassMeATree=Can't pass me a tree! cantPassMeATree=Can't pass me a tree!

+ 6
- 3
org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java Zobrazit soubor

RevCommit srcCommit = revWalk.parseCommit(srcObjectId); RevCommit srcCommit = revWalk.parseCommit(srcObjectId);


// get the parent of the commit to cherry-pick // get the parent of the commit to cherry-pick
if (srcCommit.getParentCount() != 1) {
if (srcCommit.getParentCount() != 1)
throw new MultipleParentsNotAllowedException( throw new MultipleParentsNotAllowedException(
JGitText.get().canOnlyCherryPickCommitsWithOneParent);
}
MessageFormat.format(
JGitText.get().canOnlyCherryPickCommitsWithOneParent,
srcCommit.name(),
Integer.valueOf(srcCommit.getParentCount())));

RevCommit srcParent = srcCommit.getParent(0); RevCommit srcParent = srcCommit.getParent(0);
revWalk.parseHeaders(srcParent); revWalk.parseHeaders(srcParent);



+ 4
- 1
org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java Zobrazit soubor

for (RevCommit commit : commitsToUse) { for (RevCommit commit : commitsToUse) {
if (commit.getParentCount() != 1) if (commit.getParentCount() != 1)
throw new JGitInternalException( throw new JGitInternalException(
JGitText.get().canOnlyCherryPickCommitsWithOneParent);
MessageFormat.format(
JGitText.get().canOnlyCherryPickCommitsWithOneParent,
commit.name(),
Integer.valueOf(commit.getParentCount())));
cherryPickList.add(commit); cherryPickList.add(commit);
} }



Načítá se…
Zrušit
Uložit