Skip to content

Commit c00dd33

Browse files
peffgitster
authored andcommitted
t5800: document some non-functional parts of remote helpers
These are all things one might expect to work in a helper that is capable of handling multiple branches (which our testgit helper in theory should be able to do, as it is backed by git). All of these bugs are specific to the import/export codepaths, so they don't affect helpers like git-remote-curl that use fetch/push commands. The first and fourth tests are about fetching and pushing new refs, and demonstrate bugs in the git_remote_helpers library (so they would be most likely to impact helpers for other VCSs which import/export git). The second test is about importing multiple refs; it demonstrates a bug in git-remote-testgit, which is mostly for exercising the test code. Therefore it probably doesn't affect anyone in practice. The third test demonstrates a bug in git's side of the helper code when the upstream has added refs that we do not have locally. This could impact git users who use remote helpers to access foreign VCSs. All of those bugs have fixes later in this series. The fifth test is the most complex, and does not have a fix in this series. It tests pushing a ref via the export mechanism to a new name on the remote side (i.e., "git push $remote old:new"). The problem is that we push all of the work of generating the export stream onto fast-export, but we have no way of communicating to fast-export that this name mapping is happening. So we tell fast-export to generate a stream with the commits for "old", but we can't tell it to label them all as "new". Signed-off-by: Jeff King <[email protected]> Signed-off-by: Sverre Rabbelier <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 760fec7 commit c00dd33

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

t/t5800-remote-helpers.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,51 @@ test_expect_success 'pushing remote local repo' '
8585
compare_refs clone HEAD server HEAD
8686
'
8787

88+
test_expect_failure 'fetch new branch' '
89+
(cd public &&
90+
git checkout -b new &&
91+
echo content >>file &&
92+
git commit -a -m five &&
93+
git push origin new
94+
) &&
95+
(cd localclone &&
96+
git fetch origin new
97+
) &&
98+
compare_refs public HEAD localclone FETCH_HEAD
99+
'
100+
101+
test_expect_failure 'fetch multiple branches' '
102+
(cd localclone &&
103+
git fetch
104+
) &&
105+
compare_refs server master localclone refs/remotes/origin/master &&
106+
compare_refs server new localclone refs/remotes/origin/new
107+
'
108+
109+
test_expect_failure 'push when remote has extra refs' '
110+
(cd clone &&
111+
echo content >>file &&
112+
git commit -a -m six &&
113+
git push
114+
) &&
115+
compare_refs clone master server master
116+
'
117+
118+
test_expect_failure 'push new branch by name' '
119+
(cd clone &&
120+
git checkout -b new-name &&
121+
echo content >>file &&
122+
git commit -a -m seven &&
123+
git push origin new-name
124+
) &&
125+
compare_refs clone HEAD server refs/heads/new-name
126+
'
127+
128+
test_expect_failure 'push new branch with old:new refspec' '
129+
(cd clone &&
130+
git push origin new-name:new-refspec
131+
) &&
132+
compare_refs clone HEAD server refs/heads/new-refspec
133+
'
134+
88135
test_done

0 commit comments

Comments
 (0)