summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c00dd33)
raw | patch | inline | side by side (parent: c00dd33)
author | Jeff King <peff@peff.net> | |
Sat, 16 Jul 2011 13:03:25 +0000 (15:03 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 19 Jul 2011 18:17:47 +0000 (11:17 -0700) |
Upon receiving an "import" command, the testgit remote
helper would ignore the ref asked for by git and generate a
fast-export stream based on HEAD. Instead, we should
actually give git the ref it asked for.
This requires adding a new parameter to the export_repo
method in the remote-helpers python library, which may be
used by code outside of git.git. We use a default parameter
so that callers without the new parameter will get the same
behavior as before.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
helper would ignore the ref asked for by git and generate a
fast-export stream based on HEAD. Instead, we should
actually give git the ref it asked for.
This requires adding a new parameter to the export_repo
method in the remote-helpers python library, which may be
used by code outside of git.git. We use a default parameter
so that callers without the new parameter will get the same
behavior as before.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-remote-testgit.py | patch | blob | history | |
git_remote_helpers/git/exporter.py | patch | blob | history | |
t/t5800-remote-helpers.sh | patch | blob | history |
diff --git a/git-remote-testgit.py b/git-remote-testgit.py
index df9d512f1a966635828cb7a8dadde3b0c2b7b9d8..e4a99a33eff4affccb32ceac08296decf02cc8ec 100644 (file)
--- a/git-remote-testgit.py
+++ b/git-remote-testgit.py
die("Need gitdir to import")
repo = update_local_repo(repo)
- repo.exporter.export_repo(repo.gitdir)
+ repo.exporter.export_repo(repo.gitdir, args)
def do_export(repo, args):
index f40f9d6a29cda39ee7f989e11ef66cdf3d54d625..bc39163d77738145c51e131b4a69a66cc3b3626e 100644 (file)
self.repo = repo
- def export_repo(self, base):
+ def export_repo(self, base, refs=None):
"""Exports a fast-export stream for the given directory.
Simply delegates to git fast-epxort and pipes it through sed
default refs/heads. This is to demonstrate how the export
data can be stored under it's own ref (using the refspec
capability).
+
+ If None, refs defaults to ["HEAD"].
"""
+ if not refs:
+ refs = ["HEAD"]
+
dirname = self.repo.get_base_path(base)
path = os.path.abspath(os.path.join(dirname, 'testgit.marks'))
if os.path.exists(path):
args.append("--import-marks=" + path)
- args.append("HEAD")
+ args.extend(refs)
p1 = subprocess.Popen(args, stdout=subprocess.PIPE)
index 9db8ca884e4044411b8f37136118f265a6c517d6..ca115ccb74997fbc95b272c8b61b388b81769371 100755 (executable)
compare_refs clone HEAD server HEAD
'
-test_expect_failure 'fetch new branch' '
+test_expect_success 'fetch new branch' '
(cd public &&
git checkout -b new &&
echo content >>file &&