* Allow both unicode and byte strings for host paths
in dulwich.client. (#435, Jelmer Vernooij)
+ * Add remote from porcelain.clone. (#466, Jelmer Vernooij)
+
0.16.1 2016-12-25
BUG FIXES
def set(self, section, name, value):
if not isinstance(section, tuple):
section = (section, )
+ if not isinstance(name, bytes):
+ raise TypeError(name)
+ if type(value) not in (bool, bytes):
+ raise TypeError(value)
self._values.setdefault(section, OrderedDict())[name] = value
def iteritems(self, section):
if n.startswith(b'refs/tags/') and
not n.endswith(ANNOTATED_TAG_SUFFIX)})
r[b"HEAD"] = remote_refs[b"HEAD"]
+ target_config = r.get_config()
+ if not isinstance(source, bytes):
+ source = source.encode(DEFAULT_ENCODING)
+ target_config.set((b'remote', b'origin'), b'url', source)
+ target_config.set((b'remote', b'origin'), b'fetch',
+ b'+refs/heads/*:refs/remotes/origin/*')
+ target_config.write_to_path()
if checkout:
errstream.write(b'Checking out HEAD\n')
r.reset_index()
target.refs.add_if_new(DEFAULT_REF, self.refs[DEFAULT_REF])
except KeyError:
pass
+ target_config = target.get_config()
+ encoded_path = self.path
+ if not isinstance(encoded_path, bytes):
+ encoded_path = encoded_path.encode(sys.getfilesystemencoding())
+ target_config.set((b'remote', b'origin'), b'url', encoded_path)
+ target_config.set((b'remote', b'origin'), b'fetch',
+ b'+refs/heads/*:refs/remotes/origin/*')
+ target_config.write_to_path()
# Update target head
head_chain, head_sha = self.refs.follow(b'HEAD')
self.assertEqual(c3.id, target_repo.refs[b'refs/tags/foo'])
self.assertTrue(b'f1' not in os.listdir(target_path))
self.assertTrue(b'f2' not in os.listdir(target_path))
+ c = r.get_config()
+ encoded_path = self.repo.path
+ if not isinstance(encoded_path, bytes):
+ encoded_path = encoded_path.encode('utf-8')
+ self.assertEqual(encoded_path, c.get((b'remote', b'origin'), b'url'))
+ self.assertEqual(
+ b'+refs/heads/*:refs/remotes/origin/*',
+ c.get((b'remote', b'origin'), b'fetch'))
def test_simple_local_with_checkout(self):
f1_1 = make_object(Blob, data=b'f1')
shas = [e.commit.id for e in r.get_walker()]
self.assertEqual(shas, [t.head(),
b'2a72d929692c41d8554c07f6301757ba18a65d91'])
+ c = t.get_config()
+ encoded_path = r.path
+ if not isinstance(encoded_path, bytes):
+ encoded_path = encoded_path.encode(sys.getfilesystemencoding())
+ self.assertEqual(encoded_path, c.get((b'remote', b'origin'), b'url'))
+ self.assertEqual(
+ b'+refs/heads/*:refs/remotes/origin/*',
+ c.get((b'remote', b'origin'), b'fetch'))
def test_clone_no_head(self):
temp_dir = self.mkdtemp()