← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] ~cjwatson/git-build-recipe:tolerate-missing-HEAD into git-build-recipe:master

 


Diff comments:

> diff --git a/gitbuildrecipe/tests/test_recipe.py b/gitbuildrecipe/tests/test_recipe.py
> index ed7634d..7628a45 100644
> --- a/gitbuildrecipe/tests/test_recipe.py
> +++ b/gitbuildrecipe/tests/test_recipe.py
> @@ -891,6 +891,20 @@ class BuildTreeTests(GitTestCase):
>          self.assertRaises(
>              TargetAlreadyExists, pull_or_clone, base_branch, "target")
>  
> +    def test_pull_or_clone_with_no_HEAD(self):
> +        source = GitRepository("source")
> +        source.build_tree(["a"])
> +        source.add(["a"])
> +        commit = source.commit("one")
> +        source.branch("source/master", commit)
> +        source.set_head("refs/heads/nonexistent")

Is this the same as not having a HEAD?

> +        base_branch = BaseRecipeBranch(
> +            "source", "1", 0.2, revspec="source/master")
> +        pull_or_clone(base_branch, "target")
> +        target = GitRepository("target", allow_create=False)
> +        self.assertEqual(commit, target.last_revision())
> +        self.assertEqual(commit, target.rev_parse("source/master"))
> +
>      def test_build_tree_runs_commands(self):
>          source = GitRepository("source")
>          commit = source.commit("one")


-- 
https://code.launchpad.net/~cjwatson/git-build-recipe/+git/git-build-recipe/+merge/368050
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/git-build-recipe:tolerate-missing-HEAD into git-build-recipe:master.


References