You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (C) 2012, IBM Corporation and others. and others
  3. *
  4. * This program and the accompanying materials are made available under the
  5. * terms of the Eclipse Distribution License v. 1.0 which is available at
  6. * https://www.eclipse.org/org/documents/edl-v10.php.
  7. *
  8. * SPDX-License-Identifier: BSD-3-Clause
  9. */
  10. package org.eclipse.jgit.pgm;
  11. import static org.junit.Assert.assertArrayEquals;
  12. import org.eclipse.jgit.lib.CLIRepositoryTestCase;
  13. import org.junit.Test;
  14. public class CommitAndLogTest extends CLIRepositoryTestCase {
  15. @Test
  16. public void testCommitAmend() throws Exception {
  17. assertArrayEquals(new String[] { // commit
  18. "[master 101cffba0364877df1942891eba7f465f628a3d2] first comit", //
  19. "", // amend
  20. "[master d2169869dadf16549be20dcf8c207349d2ed6c62] first commit", //
  21. "", // log
  22. "commit d2169869dadf16549be20dcf8c207349d2ed6c62", //
  23. "Author: GIT_COMMITTER_NAME <GIT_COMMITTER_EMAIL>", //
  24. "Date: Sat Aug 15 20:12:58 2009 -0330", //
  25. "", //
  26. " first commit", //
  27. "", //
  28. "" //
  29. }, execute("git commit -m 'first comit'", //
  30. "git commit --amend -m 'first commit'", //
  31. "git log"));
  32. }
  33. }