aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2007-02-22 01:59:14 +0100
committerJunio C Hamano <junkio@cox.net>2007-02-22 22:30:33 -0800
commit2e0afafebd8c5a1a8cdddb0714073461229ecfef (patch)
treeeba8a2fa0f5c7d5de4043141bd6ce33bb7b34034 /t
parent437b1b20df4b356c9342dac8d38849f24ef44f27 (diff)
downloadgit-2e0afafebd8c5a1a8cdddb0714073461229ecfef.tar.gz
git-2e0afafebd8c5a1a8cdddb0714073461229ecfef.tar.xz
Add git-bundle: move objects and references by archive
Some workflows require use of repositories on machines that cannot be connected, preventing use of git-fetch / git-push to transport objects and references between the repositories. git-bundle provides an alternate transport mechanism, effectively allowing git-fetch and git-pull to operate using sneakernet transport. `git-bundle create` allows the user to create a bundle containing one or more branches or tags, but with specified basis assumed to exist on the target repository. At the receiving end, git-bundle acts like git-fetch-pack, allowing the user to invoke git-fetch or git-pull using the bundle file as the URL. git-fetch and git-ls-remote determine they have a bundle URL by checking that the URL points to a file, but are otherwise unchanged in operation with bundles. The original patch was done by Mark Levedahl <mdl123@verizon.net>. It was updated to make git-bundle a builtin, and get rid of the tar format: now, the first line is supposed to say "# v2 git bundle", the next lines either contain a prerequisite ("-" followed by the hash of the needed commit), or a ref (the hash of a commit, followed by the name of the ref), and finally the pack. As a result, the bundle argument can be "-" now. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 't')
-rwxr-xr-xt/t5510-fetch.sh28
1 files changed, 27 insertions, 1 deletions
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 50c64856f..fa76662dc 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -35,7 +35,9 @@ test_expect_success "clone and setup child repos" '
echo "URL: ../two/.git/"
echo "Pull: refs/heads/master:refs/heads/two"
echo "Pull: refs/heads/one:refs/heads/one"
- } >.git/remotes/two
+ } >.git/remotes/two &&
+ cd .. &&
+ git clone . bundle
'
test_expect_success "fetch test" '
@@ -81,4 +83,28 @@ test_expect_success 'fetch following tags' '
'
+test_expect_success 'create bundle 1' '
+ cd "$D" &&
+ echo >file updated again by origin &&
+ git commit -a -m "tip" &&
+ git bundle create bundle1 master^..master
+'
+
+test_expect_success 'create bundle 2' '
+ cd "$D" &&
+ git bundle create bundle2 master~2..master
+'
+
+test_expect_failure 'unbundle 1' '
+ cd "$D/bundle" &&
+ git checkout -b some-branch &&
+ git fetch "$D/bundle1" master:master
+'
+
+test_expect_success 'unbundle 2' '
+ cd "$D/bundle" &&
+ git fetch ../bundle2 master:master &&
+ test "tip" = "$(git log -1 --pretty=oneline master | cut -b42-)"
+'
+
test_done