Exemplo n.º 1
0
 def test_full(self):
     r = {b"refs/heads/foo": "bla"}
     self.assertEqual([(b"refs/heads/foo", b"refs/heads/foo", False)],
                      parse_reftuples(r, r, b"refs/heads/foo"))
     r = {b"refs/heads/foo": "bla"}
     self.assertEqual([(b"refs/heads/foo", b"refs/heads/foo", True)],
                      parse_reftuples(r, r, b"refs/heads/foo", True))
Exemplo n.º 2
0
 def update_refs(refs):
     selected_refs.extend(parse_reftuples(r.refs, refs, refspecs))
     # TODO: Handle selected_refs == {None: None}
     for (lh, rh, force) in selected_refs:
         if lh is None:
             del refs[rh]
         else:
             refs[rh] = r.refs[lh]
     return refs
Exemplo n.º 3
0
 def update_refs(refs):
     selected_refs.extend(parse_reftuples(r.refs, refs, refspecs))
     # TODO: Handle selected_refs == {None: None}
     for (lh, rh, force) in selected_refs:
         if lh is None:
             del refs[rh]
         else:
             refs[rh] = r.refs[lh]
     return refs
Exemplo n.º 4
0
 def update_refs(refs):
     selected_refs.extend(parse_reftuples(r.refs, refs, refspecs))
     new_refs = {}
     # TODO: Handle selected_refs == {None: None}
     for (lh, rh, force) in selected_refs:
         if lh is None:
             new_refs[rh] = ZERO_SHA
         else:
             new_refs[rh] = r.refs[lh]
     return new_refs
Exemplo n.º 5
0
 def update_refs(refs):
     selected_refs.extend(parse_reftuples(r.refs, refs, refspecs))
     new_refs = {}
     # TODO: Handle selected_refs == {None: None}
     for (lh, rh, force) in selected_refs:
         if lh is None:
             new_refs[rh] = ZERO_SHA
         else:
             new_refs[rh] = r.refs[lh]
     return new_refs
Exemplo n.º 6
0
 def determine_wants(remote_refs):
     fetch_refs.extend(
         parse_reftuples(
             remote_refs,
             self.repo.refs,
             [os.fsencode(refspec) for refspec in refspecs],
             force=force,
         ))
     return [
         remote_refs[lh] for (lh, _, _) in fetch_refs
         if remote_refs[lh] not in self.repo.object_store
     ]
Exemplo n.º 7
0
 def determine_wants(remote_refs):
     selected_refs.extend(parse_reftuples(remote_refs, r.refs,
                                          refspecs))
     return [remote_refs[lh] for (lh, rh, force) in selected_refs]
Exemplo n.º 8
0
 def test_full(self):
     r = {b"refs/heads/foo": "bla"}
     self.assertEqual([(b"refs/heads/foo", b"refs/heads/foo", False)],
         parse_reftuples(r, r, b"refs/heads/foo"))
Exemplo n.º 9
0
 def test_head(self):
     r = {b"refs/heads/foo": "bla"}
     self.assertEqual([(b"refs/heads/foo", b"refs/heads/foo", False)],
         parse_reftuples(r, r, [b"foo"]))
Exemplo n.º 10
0
 def determine_wants(remote_refs):
     selected_refs.extend(
         parse_reftuples(remote_refs, r.refs, refspecs))
     return [remote_refs[lh] for (lh, rh, force) in selected_refs]
Exemplo n.º 11
0
 def determine_wants(remote_refs):
     selected_refs.extend(
         parse_reftuples(remote_refs, self.git_repository.refs,
                         self.remote_fetch_refs))
     return [remote_refs[lh] for (lh, rh, force) in selected_refs]