summaryrefslogtreecommitdiff
path: root/git_remote_helpers/git/non_local.py
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2011-08-01 15:00:14 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-08-01 15:00:14 -0700
commit59d9ba869e900bf4da9822f417e4d40a710d8063 (patch)
tree07f1a07ddcff4c61e52cb959e6e7c0eec7abeb53 /git_remote_helpers/git/non_local.py
parentMerge branch 'jc/maint-reset-unmerged-path' (diff)
parenttransport-helper: die early on encountering deleted refs (diff)
downloadtgif-59d9ba869e900bf4da9822f417e4d40a710d8063.tar.xz
Merge branch 'sr/transport-helper-fix'
* sr/transport-helper-fix: (21 commits) transport-helper: die early on encountering deleted refs transport-helper: implement marks location as capability transport-helper: Use capname for refspec capability too transport-helper: change import semantics transport-helper: update ref status after push with export transport-helper: use the new done feature where possible transport-helper: check status code of finish_command transport-helper: factor out push_update_refs_status fast-export: support done feature fast-import: introduce 'done' command git-remote-testgit: fix error handling git-remote-testgit: only push for non-local repositories remote-curl: accept empty line as terminator remote-helpers: export GIT_DIR variable to helpers git_remote_helpers: push all refs during a non-local export transport-helper: don't feed bogus refs to export push git-remote-testgit: import non-HEAD refs t5800: document some non-functional parts of remote helpers t5800: use skip_all instead of prereq t5800: factor out some ref tests ...
Diffstat (limited to 'git_remote_helpers/git/non_local.py')
-rw-r--r--git_remote_helpers/git/non_local.py20
1 files changed, 6 insertions, 14 deletions
diff --git a/git_remote_helpers/git/non_local.py b/git_remote_helpers/git/non_local.py
index f27389bb94..e70025095d 100644
--- a/git_remote_helpers/git/non_local.py
+++ b/git_remote_helpers/git/non_local.py
@@ -1,7 +1,7 @@
import os
import subprocess
-from git_remote_helpers.util import die, warn
+from git_remote_helpers.util import check_call, die, warn
class NonLocalGit(object):
@@ -29,9 +29,7 @@ class NonLocalGit(object):
os.makedirs(path)
args = ["git", "clone", "--bare", "--quiet", self.repo.gitpath, path]
- child = subprocess.Popen(args)
- if child.wait() != 0:
- raise CalledProcessError
+ check_call(args)
return path
@@ -45,14 +43,10 @@ class NonLocalGit(object):
die("could not find repo at %s", path)
args = ["git", "--git-dir=" + path, "fetch", "--quiet", self.repo.gitpath]
- child = subprocess.Popen(args)
- if child.wait() != 0:
- raise CalledProcessError
+ check_call(args)
args = ["git", "--git-dir=" + path, "update-ref", "refs/heads/master", "FETCH_HEAD"]
- child = subprocess.Popen(args)
- if child.wait() != 0:
- raise CalledProcessError
+ child = check_call(args)
def push(self, base):
"""Pushes from the non-local repo to base.
@@ -63,7 +57,5 @@ class NonLocalGit(object):
if not os.path.exists(path):
die("could not find repo at %s", path)
- args = ["git", "--git-dir=" + path, "push", "--quiet", self.repo.gitpath]
- child = subprocess.Popen(args)
- if child.wait() != 0:
- raise CalledProcessError
+ args = ["git", "--git-dir=" + path, "push", "--quiet", self.repo.gitpath, "--all"]
+ child = check_call(args)