aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2018-08-08 10:29:40 +0200
committerGuido Günther <agx@sigxcpu.org>2018-08-08 11:27:45 +0200
commit6dda2da54efbb81e4e1593d57eb5f30c4ef1e6d8 (patch)
tree7815a6a9a4c789d217907c754e34d89b51a3abe3 /tests
parentea321fdfa1ec917038d09c14036ae9e27108735b (diff)
pull: allow to set up branch tracking for missing branches
If the remote branch does not exist at all that's currently not fatal.
Diffstat (limited to 'tests')
-rw-r--r--tests/component/deb/test_pull.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/component/deb/test_pull.py b/tests/component/deb/test_pull.py
index 030acf10..3b34ce49 100644
--- a/tests/component/deb/test_pull.py
+++ b/tests/component/deb/test_pull.py
@@ -79,3 +79,28 @@ class TestPull(ComponentTestBase):
eq_(pull(['argv0', '--all']), 0)
eq_(len(cloned.get_commits(until='foob')), 3)
eq_(len(cloned.get_commits(until='upstream')), 2)
+
+ @RepoFixtures.native()
+ def test_tracking(self, repo):
+ """Test that --track-missing picks up missing branches"""
+ dest = os.path.join(self._tmpdir, 'cloned_repo')
+ clone(['arg0', repo.path, dest])
+ cloned = ComponentTestGitRepository(dest)
+ os.chdir(cloned.path)
+ self._check_repo_state(cloned, 'master', ['master'])
+ # Pull initially
+ eq_(pull(['argv0']), 0)
+ assert len(repo.get_commits()) == 1
+ self._check_repo_state(cloned, 'master', ['master'])
+
+ # Pick up missing branches (none exist yet)
+ eq_(pull(['argv0', '--track-missing']), 0)
+ assert len(repo.get_commits()) == 1
+ self._check_repo_state(cloned, 'master', ['master'])
+
+ # Pick up missing branches
+ repo.create_branch('pristine-tar')
+ repo.create_branch('upstream')
+ eq_(pull(['argv0', '--track-missing', '--pristine-tar']), 0)
+ assert len(repo.get_commits()) == 1
+ self._check_repo_state(cloned, 'master', ['master', 'pristine-tar', 'upstream'])