File tree Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change 11
11
url=$2
12
12
13
13
dir=" $GIT_DIR /testgit/$alias "
14
- prefix=" refs/testgit/$alias "
15
14
16
- default_refspec =" refs/heads/*:${prefix} /heads/*"
15
+ refspec =" refs/heads/*:refs/testgit/ $alias /heads/*"
17
16
18
- refspec=" ${GIT_REMOTE_TESTGIT_REFSPEC-$default_refspec } "
19
-
20
- test -z " $refspec " && prefix=" refs"
17
+ test -n " $GIT_REMOTE_TESTGIT_NOREFSPEC " && refspec=" "
21
18
22
19
GIT_DIR=" $url /.git"
23
20
export GIT_DIR
81
78
82
79
echo " feature done"
83
80
git fast-export \
81
+ ${refspec: +" --refspec=$refspec " } \
84
82
${testgitmarks: +" --import-marks=$testgitmarks " } \
85
83
${testgitmarks: +" --export-marks=$testgitmarks " } \
86
- $refs |
87
- sed -e " s#refs/heads/#${prefix} /heads/#g"
84
+ $refs
88
85
echo " done"
89
86
;;
90
87
export)
Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ test_expect_success 'forced push' '
124
124
'
125
125
126
126
test_expect_success ' cloning without refspec' '
127
- GIT_REMOTE_TESTGIT_REFSPEC="" \
127
+ GIT_REMOTE_TESTGIT_NOREFSPEC=1 \
128
128
git clone "testgit::${PWD}/server" local2 2>error &&
129
129
test_i18ngrep "this remote helper should implement refspec capability" error &&
130
130
compare_refs local2 HEAD server HEAD
@@ -133,7 +133,7 @@ test_expect_success 'cloning without refspec' '
133
133
test_expect_success ' pulling without refspecs' '
134
134
(cd local2 &&
135
135
git reset --hard &&
136
- GIT_REMOTE_TESTGIT_REFSPEC="" git pull 2>../error) &&
136
+ GIT_REMOTE_TESTGIT_NOREFSPEC=1 git pull 2>../error) &&
137
137
test_i18ngrep "this remote helper should implement refspec capability" error &&
138
138
compare_refs local2 HEAD server HEAD
139
139
'
@@ -143,8 +143,8 @@ test_expect_success 'pushing without refspecs' '
143
143
(cd local2 &&
144
144
echo content >>file &&
145
145
git commit -a -m ten &&
146
- GIT_REMOTE_TESTGIT_REFSPEC="" &&
147
- export GIT_REMOTE_TESTGIT_REFSPEC &&
146
+ GIT_REMOTE_TESTGIT_NOREFSPEC=1 &&
147
+ export GIT_REMOTE_TESTGIT_NOREFSPEC &&
148
148
test_must_fail git push 2>../error) &&
149
149
test_i18ngrep "remote-helper doesn.t support push; refspec needed" error
150
150
'
You can’t perform that action at this time.
0 commit comments