aboutsummaryrefslogtreecommitdiffstats
path: root/remote_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'remote_test.go')
-rw-r--r--remote_test.go21
1 files changed, 19 insertions, 2 deletions
diff --git a/remote_test.go b/remote_test.go
index dff1499..e586e7a 100644
--- a/remote_test.go
+++ b/remote_test.go
@@ -308,8 +308,8 @@ func (s *RemoteSuite) doTestFetchNoErrAlreadyUpToDate(c *C, url string) {
c.Assert(err, Equals, NoErrAlreadyUpToDate)
}
-func (s *RemoteSuite) TestFetchFastForward(c *C) {
- r := newRemote(memory.NewStorage(), &config.RemoteConfig{
+func (s *RemoteSuite) testFetchFastForward(c *C, sto storage.Storer) {
+ r := newRemote(sto, &config.RemoteConfig{
URLs: []string{s.GetBasicLocalRepositoryURL()},
})
@@ -350,6 +350,23 @@ func (s *RemoteSuite) TestFetchFastForward(c *C) {
})
}
+func (s *RemoteSuite) TestFetchFastForwardMem(c *C) {
+ s.testFetchFastForward(c, memory.NewStorage())
+}
+
+func (s *RemoteSuite) TestFetchFastForwardFS(c *C) {
+ dir, err := ioutil.TempDir("", "fetch")
+ c.Assert(err, IsNil)
+
+ defer os.RemoveAll(dir) // clean up
+
+ fss, err := filesystem.NewStorage(osfs.New(dir))
+ c.Assert(err, IsNil)
+
+ // This exercises `storage.filesystem.Storage.CheckAndSetReference()`.
+ s.testFetchFastForward(c, fss)
+}
+
func (s *RemoteSuite) TestString(c *C) {
r := newRemote(nil, &config.RemoteConfig{
Name: "foo",