@ -90,7 +90,7 @@ public class AddCommandTest extends RepositoryTestCase {
@Test
@Test
public void testAddExistingSingleFile ( ) throws IOException , NoFilepatternException {
public void testAddExistingSingleFile ( ) throws IOException , NoFilepatternException {
File file = new File ( db . getWorkTree ( ) , "a.txt" ) ;
File file = new File ( db . getWorkTree ( ) , "a.txt" ) ;
file . createNewFile ( ) ;
FileUtils . createNewFile ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
writer . print ( "content" ) ;
writer . print ( "content" ) ;
writer . close ( ) ;
writer . close ( ) ;
@ -106,9 +106,9 @@ public class AddCommandTest extends RepositoryTestCase {
@Test
@Test
public void testAddExistingSingleFileInSubDir ( ) throws IOException , NoFilepatternException {
public void testAddExistingSingleFileInSubDir ( ) throws IOException , NoFilepatternException {
new File ( db . getWorkTree ( ) , "sub" ) . mkdir ( ) ;
FileUtils . mkdir ( new File ( db . getWorkTree ( ) , "sub" ) ) ;
File file = new File ( db . getWorkTree ( ) , "sub/a.txt" ) ;
File file = new File ( db . getWorkTree ( ) , "sub/a.txt" ) ;
file . createNewFile ( ) ;
FileUtils . createNewFile ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
writer . print ( "content" ) ;
writer . print ( "content" ) ;
writer . close ( ) ;
writer . close ( ) ;
@ -125,7 +125,7 @@ public class AddCommandTest extends RepositoryTestCase {
@Test
@Test
public void testAddExistingSingleFileTwice ( ) throws IOException , NoFilepatternException {
public void testAddExistingSingleFileTwice ( ) throws IOException , NoFilepatternException {
File file = new File ( db . getWorkTree ( ) , "a.txt" ) ;
File file = new File ( db . getWorkTree ( ) , "a.txt" ) ;
file . createNewFile ( ) ;
FileUtils . createNewFile ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
writer . print ( "content" ) ;
writer . print ( "content" ) ;
writer . close ( ) ;
writer . close ( ) ;
@ -149,7 +149,7 @@ public class AddCommandTest extends RepositoryTestCase {
@Test
@Test
public void testAddExistingSingleFileTwiceWithCommit ( ) throws Exception {
public void testAddExistingSingleFileTwiceWithCommit ( ) throws Exception {
File file = new File ( db . getWorkTree ( ) , "a.txt" ) ;
File file = new File ( db . getWorkTree ( ) , "a.txt" ) ;
file . createNewFile ( ) ;
FileUtils . createNewFile ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
writer . print ( "content" ) ;
writer . print ( "content" ) ;
writer . close ( ) ;
writer . close ( ) ;
@ -175,7 +175,7 @@ public class AddCommandTest extends RepositoryTestCase {
@Test
@Test
public void testAddRemovedFile ( ) throws Exception {
public void testAddRemovedFile ( ) throws Exception {
File file = new File ( db . getWorkTree ( ) , "a.txt" ) ;
File file = new File ( db . getWorkTree ( ) , "a.txt" ) ;
file . createNewFile ( ) ;
FileUtils . createNewFile ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
writer . print ( "content" ) ;
writer . print ( "content" ) ;
writer . close ( ) ;
writer . close ( ) ;
@ -197,7 +197,7 @@ public class AddCommandTest extends RepositoryTestCase {
@Test
@Test
public void testAddRemovedCommittedFile ( ) throws Exception {
public void testAddRemovedCommittedFile ( ) throws Exception {
File file = new File ( db . getWorkTree ( ) , "a.txt" ) ;
File file = new File ( db . getWorkTree ( ) , "a.txt" ) ;
file . createNewFile ( ) ;
FileUtils . createNewFile ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
writer . print ( "content" ) ;
writer . print ( "content" ) ;
writer . close ( ) ;
writer . close ( ) ;
@ -223,13 +223,13 @@ public class AddCommandTest extends RepositoryTestCase {
// prepare conflict
// prepare conflict
File file = new File ( db . getWorkTree ( ) , "a.txt" ) ;
File file = new File ( db . getWorkTree ( ) , "a.txt" ) ;
file . createNewFile ( ) ;
FileUtils . createNewFile ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
writer . print ( "content" ) ;
writer . print ( "content" ) ;
writer . close ( ) ;
writer . close ( ) ;
File file2 = new File ( db . getWorkTree ( ) , "b.txt" ) ;
File file2 = new File ( db . getWorkTree ( ) , "b.txt" ) ;
file2 . createNewFile ( ) ;
FileUtils . createNewFile ( file2 ) ;
writer = new PrintWriter ( file2 ) ;
writer = new PrintWriter ( file2 ) ;
writer . print ( "content b" ) ;
writer . print ( "content b" ) ;
writer . close ( ) ;
writer . close ( ) ;
@ -275,13 +275,13 @@ public class AddCommandTest extends RepositoryTestCase {
@Test
@Test
public void testAddTwoFiles ( ) throws Exception {
public void testAddTwoFiles ( ) throws Exception {
File file = new File ( db . getWorkTree ( ) , "a.txt" ) ;
File file = new File ( db . getWorkTree ( ) , "a.txt" ) ;
file . createNewFile ( ) ;
FileUtils . createNewFile ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
writer . print ( "content" ) ;
writer . print ( "content" ) ;
writer . close ( ) ;
writer . close ( ) ;
File file2 = new File ( db . getWorkTree ( ) , "b.txt" ) ;
File file2 = new File ( db . getWorkTree ( ) , "b.txt" ) ;
file2 . createNewFile ( ) ;
FileUtils . createNewFile ( file2 ) ;
writer = new PrintWriter ( file2 ) ;
writer = new PrintWriter ( file2 ) ;
writer . print ( "content b" ) ;
writer . print ( "content b" ) ;
writer . close ( ) ;
writer . close ( ) ;
@ -296,15 +296,15 @@ public class AddCommandTest extends RepositoryTestCase {
@Test
@Test
public void testAddFolder ( ) throws Exception {
public void testAddFolder ( ) throws Exception {
new File ( db . getWorkTree ( ) , "sub" ) . mkdir ( ) ;
FileUtils . mkdir ( new File ( db . getWorkTree ( ) , "sub" ) ) ;
File file = new File ( db . getWorkTree ( ) , "sub/a.txt" ) ;
File file = new File ( db . getWorkTree ( ) , "sub/a.txt" ) ;
file . createNewFile ( ) ;
FileUtils . createNewFile ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
writer . print ( "content" ) ;
writer . print ( "content" ) ;
writer . close ( ) ;
writer . close ( ) ;
File file2 = new File ( db . getWorkTree ( ) , "sub/b.txt" ) ;
File file2 = new File ( db . getWorkTree ( ) , "sub/b.txt" ) ;
file2 . createNewFile ( ) ;
FileUtils . createNewFile ( file2 ) ;
writer = new PrintWriter ( file2 ) ;
writer = new PrintWriter ( file2 ) ;
writer . print ( "content b" ) ;
writer . print ( "content b" ) ;
writer . close ( ) ;
writer . close ( ) ;
@ -319,21 +319,21 @@ public class AddCommandTest extends RepositoryTestCase {
@Test
@Test
public void testAddIgnoredFile ( ) throws Exception {
public void testAddIgnoredFile ( ) throws Exception {
new File ( db . getWorkTree ( ) , "sub" ) . mkdir ( ) ;
FileUtils . mkdir ( new File ( db . getWorkTree ( ) , "sub" ) ) ;
File file = new File ( db . getWorkTree ( ) , "sub/a.txt" ) ;
File file = new File ( db . getWorkTree ( ) , "sub/a.txt" ) ;
file . createNewFile ( ) ;
FileUtils . createNewFile ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
writer . print ( "content" ) ;
writer . print ( "content" ) ;
writer . close ( ) ;
writer . close ( ) ;
File ignoreFile = new File ( db . getWorkTree ( ) , ".gitignore" ) ;
File ignoreFile = new File ( db . getWorkTree ( ) , ".gitignore" ) ;
ignoreFile . createNewFile ( ) ;
FileUtils . createNewFile ( ignoreFile ) ;
writer = new PrintWriter ( ignoreFile ) ;
writer = new PrintWriter ( ignoreFile ) ;
writer . print ( "sub/b.txt" ) ;
writer . print ( "sub/b.txt" ) ;
writer . close ( ) ;
writer . close ( ) ;
File file2 = new File ( db . getWorkTree ( ) , "sub/b.txt" ) ;
File file2 = new File ( db . getWorkTree ( ) , "sub/b.txt" ) ;
file2 . createNewFile ( ) ;
FileUtils . createNewFile ( file2 ) ;
writer = new PrintWriter ( file2 ) ;
writer = new PrintWriter ( file2 ) ;
writer . print ( "content b" ) ;
writer . print ( "content b" ) ;
writer . close ( ) ;
writer . close ( ) ;
@ -348,15 +348,15 @@ public class AddCommandTest extends RepositoryTestCase {
@Test
@Test
public void testAddWholeRepo ( ) throws Exception {
public void testAddWholeRepo ( ) throws Exception {
new File ( db . getWorkTree ( ) , "sub" ) . mkdir ( ) ;
FileUtils . mkdir ( new File ( db . getWorkTree ( ) , "sub" ) ) ;
File file = new File ( db . getWorkTree ( ) , "sub/a.txt" ) ;
File file = new File ( db . getWorkTree ( ) , "sub/a.txt" ) ;
file . createNewFile ( ) ;
FileUtils . createNewFile ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
writer . print ( "content" ) ;
writer . print ( "content" ) ;
writer . close ( ) ;
writer . close ( ) ;
File file2 = new File ( db . getWorkTree ( ) , "sub/b.txt" ) ;
File file2 = new File ( db . getWorkTree ( ) , "sub/b.txt" ) ;
file2 . createNewFile ( ) ;
FileUtils . createNewFile ( file2 ) ;
writer = new PrintWriter ( file2 ) ;
writer = new PrintWriter ( file2 ) ;
writer . print ( "content b" ) ;
writer . print ( "content b" ) ;
writer . close ( ) ;
writer . close ( ) ;
@ -375,15 +375,15 @@ public class AddCommandTest extends RepositoryTestCase {
// file c exists in workdir but not in index -> added
// file c exists in workdir but not in index -> added
@Test
@Test
public void testAddWithoutParameterUpdate ( ) throws Exception {
public void testAddWithoutParameterUpdate ( ) throws Exception {
new File ( db . getWorkTree ( ) , "sub" ) . mkdir ( ) ;
FileUtils . mkdir ( new File ( db . getWorkTree ( ) , "sub" ) ) ;
File file = new File ( db . getWorkTree ( ) , "sub/a.txt" ) ;
File file = new File ( db . getWorkTree ( ) , "sub/a.txt" ) ;
file . createNewFile ( ) ;
FileUtils . createNewFile ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
writer . print ( "content" ) ;
writer . print ( "content" ) ;
writer . close ( ) ;
writer . close ( ) ;
File file2 = new File ( db . getWorkTree ( ) , "sub/b.txt" ) ;
File file2 = new File ( db . getWorkTree ( ) , "sub/b.txt" ) ;
file2 . createNewFile ( ) ;
FileUtils . createNewFile ( file2 ) ;
writer = new PrintWriter ( file2 ) ;
writer = new PrintWriter ( file2 ) ;
writer . print ( "content b" ) ;
writer . print ( "content b" ) ;
writer . close ( ) ;
writer . close ( ) ;
@ -400,7 +400,7 @@ public class AddCommandTest extends RepositoryTestCase {
// new unstaged file sub/c.txt
// new unstaged file sub/c.txt
File file3 = new File ( db . getWorkTree ( ) , "sub/c.txt" ) ;
File file3 = new File ( db . getWorkTree ( ) , "sub/c.txt" ) ;
file3 . createNewFile ( ) ;
FileUtils . createNewFile ( file3 ) ;
writer = new PrintWriter ( file3 ) ;
writer = new PrintWriter ( file3 ) ;
writer . print ( "content c" ) ;
writer . print ( "content c" ) ;
writer . close ( ) ;
writer . close ( ) ;
@ -429,15 +429,15 @@ public class AddCommandTest extends RepositoryTestCase {
// file c exists in workdir but not in index -> unchanged
// file c exists in workdir but not in index -> unchanged
@Test
@Test
public void testAddWithParameterUpdate ( ) throws Exception {
public void testAddWithParameterUpdate ( ) throws Exception {
new File ( db . getWorkTree ( ) , "sub" ) . mkdir ( ) ;
FileUtils . mkdir ( new File ( db . getWorkTree ( ) , "sub" ) ) ;
File file = new File ( db . getWorkTree ( ) , "sub/a.txt" ) ;
File file = new File ( db . getWorkTree ( ) , "sub/a.txt" ) ;
file . createNewFile ( ) ;
FileUtils . createNewFile ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
PrintWriter writer = new PrintWriter ( file ) ;
writer . print ( "content" ) ;
writer . print ( "content" ) ;
writer . close ( ) ;
writer . close ( ) ;
File file2 = new File ( db . getWorkTree ( ) , "sub/b.txt" ) ;
File file2 = new File ( db . getWorkTree ( ) , "sub/b.txt" ) ;
file2 . createNewFile ( ) ;
FileUtils . createNewFile ( file2 ) ;
writer = new PrintWriter ( file2 ) ;
writer = new PrintWriter ( file2 ) ;
writer . print ( "content b" ) ;
writer . print ( "content b" ) ;
writer . close ( ) ;
writer . close ( ) ;
@ -454,7 +454,7 @@ public class AddCommandTest extends RepositoryTestCase {
// new unstaged file sub/c.txt
// new unstaged file sub/c.txt
File file3 = new File ( db . getWorkTree ( ) , "sub/c.txt" ) ;
File file3 = new File ( db . getWorkTree ( ) , "sub/c.txt" ) ;
file3 . createNewFile ( ) ;
FileUtils . createNewFile ( file3 ) ;
writer = new PrintWriter ( file3 ) ;
writer = new PrintWriter ( file3 ) ;
writer . print ( "content c" ) ;
writer . print ( "content c" ) ;
writer . close ( ) ;
writer . close ( ) ;