summaryrefslogtreecommitdiff
path: root/git_test.go
diff options
context:
space:
mode:
authorJesse Ezell <[email protected]>2014-03-26 11:18:21 -0700
committerJesse Ezell <[email protected]>2014-03-26 11:18:21 -0700
commit85420f2002ae85b2e86b3c37c04e462c1cef462a (patch)
tree943fd6fef1b14db9bd6818d4b14243e6d3641b1d /git_test.go
parent8ad5cbc53763ca8e89ede40f91edab80c8def1f1 (diff)
parent2811845a1287d949a74b8ed80a5791fd8875002a (diff)
Merge branch 'master' of http://github.com/libgit2/git2go into merge
Diffstat (limited to 'git_test.go')
-rw-r--r--git_test.go21
1 files changed, 19 insertions, 2 deletions
diff --git a/git_test.go b/git_test.go
index 52aea1d..6542ca0 100644
--- a/git_test.go
+++ b/git_test.go
@@ -1,8 +1,8 @@
package git
import (
- "testing"
"io/ioutil"
+ "testing"
"time"
)
@@ -14,7 +14,17 @@ func createTestRepo(t *testing.T) *Repository {
checkFatal(t, err)
tmpfile := "README"
- err = ioutil.WriteFile(path + "/" + tmpfile, []byte("foo\n"), 0644)
+ 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
@@ -45,3 +55,10 @@ func seedTestRepo(t *testing.T, repo *Repository) (*Oid, *Oid) {
return commitId, treeId
}
+func TestOidZero(t *testing.T) {
+ var zeroId Oid
+
+ if !zeroId.IsZero() {
+ t.Error("Zero Oid is not zero")
+ }
+}