|
|
|
@ -50,6 +50,7 @@ import static org.junit.Assert.assertTrue;
|
|
|
|
|
import java.io.File; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
import org.eclipse.jgit.api.errors.WrongRepositoryStateException; |
|
|
|
|
import org.eclipse.jgit.diff.DiffEntry; |
|
|
|
|
import org.eclipse.jgit.dircache.DirCache; |
|
|
|
|
import org.eclipse.jgit.lib.ConfigConstants; |
|
|
|
@ -420,4 +421,10 @@ public class CommitCommandTest extends RepositoryTestCase {
|
|
|
|
|
assertEquals("commit: Squashed commit of the following:", db |
|
|
|
|
.getReflogReader(db.getBranch()).getLastEntry().getComment()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test(expected = WrongRepositoryStateException.class) |
|
|
|
|
public void commitAmendOnInitialShouldFail() throws Exception { |
|
|
|
|
Git git = new Git(db); |
|
|
|
|
git.commit().setAmend(true).setMessage("initial commit").call(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|