1
2
3
4
5
6
7
8
9
10 package org.eclipse.jgit.pgm;
11
12 import static org.junit.Assert.assertArrayEquals;
13
14 import org.eclipse.jgit.lib.CLIRepositoryTestCase;
15 import org.junit.Test;
16
17 public class CommitAndLogTest extends CLIRepositoryTestCase {
18 @Test
19 public void testCommitAmend() throws Exception {
20 assertArrayEquals(new String[] {
21 "[master 101cffba0364877df1942891eba7f465f628a3d2] first comit",
22 "",
23 "[master d2169869dadf16549be20dcf8c207349d2ed6c62] first commit",
24 "",
25 "commit d2169869dadf16549be20dcf8c207349d2ed6c62",
26 "Author: GIT_COMMITTER_NAME <GIT_COMMITTER_EMAIL>",
27 "Date: Sat Aug 15 20:12:58 2009 -0330",
28 "",
29 " first commit",
30 "",
31 ""
32 }, execute("git commit -m 'first comit'",
33 "git commit --amend -m 'first commit'",
34 "git log"));
35 }
36 }