aboutsummaryrefslogtreecommitdiff
path: root/git-remote-testgit.py
diff options
context:
space:
mode:
authorSverre Rabbelier <srabbelier@gmail.com>2011-07-16 15:03:40 +0200
committerJunio C Hamano <gitster@pobox.com>2011-07-19 11:17:48 -0700
commita515ebe9f1ac9bc248c12a291dc008570de505ca (patch)
tree9383e7d0d35359ab9e77522c94726d73bd6ff473 /git-remote-testgit.py
parent4d2ec306e88b4de5aeb611b18b00139c90d4fa78 (diff)
downloadgit-a515ebe9f1ac9bc248c12a291dc008570de505ca.tar.gz
git-a515ebe9f1ac9bc248c12a291dc008570de505ca.tar.xz
transport-helper: implement marks location as capability
Now that the gitdir location is exported as an environment variable this can be implemented elegantly without requiring any explicit flushes nor an ad-hoc exchange of values. Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-remote-testgit.py')
-rw-r--r--git-remote-testgit.py24
1 files changed, 11 insertions, 13 deletions
diff --git a/git-remote-testgit.py b/git-remote-testgit.py
index 1ed7a5651..e9c832bfd 100644
--- a/git-remote-testgit.py
+++ b/git-remote-testgit.py
@@ -72,6 +72,17 @@ def do_capabilities(repo, args):
print "export"
print "refspec refs/heads/*:%s*" % repo.prefix
+ dirname = repo.get_base_path(repo.gitdir)
+
+ if not os.path.exists(dirname):
+ os.makedirs(dirname)
+
+ path = os.path.join(dirname, 'testgit.marks')
+
+ print "*export-marks %s" % path
+ if os.path.exists(path):
+ print "*import-marks %s" % path
+
print # end capabilities
@@ -147,19 +158,6 @@ def do_export(repo, args):
if not repo.gitdir:
die("Need gitdir to export")
- dirname = repo.get_base_path(repo.gitdir)
-
- if not os.path.exists(dirname):
- os.makedirs(dirname)
-
- path = os.path.join(dirname, 'testgit.marks')
- print path
- if os.path.exists(path):
- print path
- else:
- print ""
- sys.stdout.flush()
-
update_local_repo(repo)
changed = repo.importer.do_import(repo.gitdir)