MCPcopy
hub / github.com/gitless-vcs/gitless / create

Method create

gitless/core.py:429–442  ·  view source on GitHub ↗
(self, name, url)

Source from the content-addressed store, hash-verified

427 return False
428
429 def create(self, name, url):
430 if '/' in name:
431 raise ValueError(
432 'Invalid remote name {0}: remotes can\'t have \'/\''.format(name))
433 if not url.strip():
434 raise ValueError('Invalid url {0}'.format(url))
435
436 # Check that the given url corresponds to a git repo
437 try:
438 git('ls-remote', '--heads', url)
439 except ErrorReturnCode as e:
440 raise ValueError(stderr(e))
441
442 self.git_remote_collection.create(name, url)
443
444 def delete(self, name):
445 self.git_remote_collection.delete(name)

Callers 7

_do_createFunction · 0.80
test_create_newMethod · 0.80
test_create_existingMethod · 0.80
test_list_allMethod · 0.80
test_deleteMethod · 0.80
setUpMethod · 0.80

Calls 1

stderrFunction · 0.70

Tested by 6

test_create_newMethod · 0.64
test_create_existingMethod · 0.64
test_list_allMethod · 0.64
test_deleteMethod · 0.64
setUpMethod · 0.64