Example #1
0
func TestContentOfDeletedFilesIsNotAvailableInChanges(t *testing.T) {
	cleanTestData()
	_, repo := setupOriginAndClones("data/testLocation1", "data/cloneLocation")
	git.RemoveFile(repo.root, "a.txt")
	git.AddAndcommit(repo.root, "a.txt", "Deleted this file. After all, it only had lorem-ipsum content.")
	assert.Equal(t, 0, len(repo.AllAdditions()), "There should be no additions because there only an outgoing deletion")
}
func TestRemovingFilesInARepoWorks(t *testing.T) {
	cleanTestData()
	repo := RepoLocatedAt("data/testLocation1")
	git.Init(repo.root)
	git.SetupBaselineFiles(repo.root, "a.txt", "alice/bob/b.txt")
	git.RemoveFile(repo.root, "a.txt")
	assert.False(t, exists("data/testLocation1/a.txt"), "Unexpected. Deleted file a.txt still exists inside the repo")
	git.AddAndcommit(repo.root, "a.txt", "removed it")
	verifyPresenceOfGitRepoWithCommits("data/testLocation1", 2, t)
}