summaryrefslogtreecommitdiff
path: root/git_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'git_test.go')
-rw-r--r--git_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/git_test.go b/git_test.go
index 2f586b5..e6372fb 100644
--- a/git_test.go
+++ b/git_test.go
@@ -15,6 +15,17 @@ func createTestRepo(t *testing.T) *Repository {
tmpfile := "README"
err = ioutil.WriteFile(path+"/"+tmpfile, []byte("foo\n"), 0644)
+
+ checkFatal(t, err)
+
+ return repo
+}
+
+func createBareTestRepo(t *testing.T) *Repository {
+ // figure out where we can create the test repo
+ path, err := ioutil.TempDir("", "git2go")
+ checkFatal(t, err)
+ repo, err := InitRepository(path, true)
checkFatal(t, err)
return repo
@@ -73,3 +84,11 @@ func updateReadme(t *testing.T, repo *Repository, content string) (*Oid, *Oid) {
return commitId, treeId
}
+
+func TestOidZero(t *testing.T) {
+ var zeroId Oid
+
+ if !zeroId.IsZero() {
+ t.Error("Zero Oid is not zero")
+ }
+}