From a87c7b616a269ee4b6b530cf5069df1423a49bd4 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 8 Feb 2012 13:52:47 +0000 Subject: Change how git clones are created from bundles For some reason, "git bundle unbundle" doesn't work for me, but "git clone" does. Then, adding a remote fails, because the cloned bundle already has one, so now we'll use "git remote set-url" and "git remote update". --- morphlib/git.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'morphlib/git.py') diff --git a/morphlib/git.py b/morphlib/git.py index 0b774229..47de2f61 100644 --- a/morphlib/git.py +++ b/morphlib/git.py @@ -221,7 +221,7 @@ def get_morph_text(treeish, filename, msg=logging.debug): def extract_bundle(location, bundle, msg=logging.debug): '''Extract a bundle into git at location''' ex = morphlib.execute.Execute(location, msg=msg) - return ex.runv(['git', 'bundle', 'unbundle', bundle]) + return ex.runv(['git', 'clone', bundle, '.']) def clone(location, repo, msg=logging.debug): '''clone at git repo into location''' @@ -234,10 +234,10 @@ def init(location, msg=logging.debug): ex = morphlib.execute.Execute(location, msg=msg) return ex.runv(['git', 'init']) -def add_remote(gitdir, name, url, msg=logging.debug): - '''add remote with name 'name' for url at gitdir''' +def set_remote(gitdir, name, url, msg=logging.debug): + '''Set remote with name 'name' use a given url at gitdir''' ex = morphlib.execute.Execute(gitdir, msg=msg) - return ex.runv(['git', 'remote', 'add', '-f', name, url]) + return ex.runv(['git', 'remote', 'set-url', name, url]) def update_remote(gitdir, name, msg=logging.debug): ex = morphlib.execute.Execute(gitdir, msg=msg) -- cgit v1.2.1