@@ -136,14 +136,14 @@ fn test_bookmark_names() {
136136 test_env. run_jj_in ( "." , [ "git" , "init" , "repo" ] ) . success ( ) ;
137137 let work_dir = test_env. work_dir ( "repo" ) ;
138138
139- test_env. run_jj_in ( "." , [ "git" , "init" , "origin" ] ) . success ( ) ;
139+ test_env
140+ . run_jj_in ( "." , [ "git" , "init" , "--colocate" , "origin" ] )
141+ . success ( ) ;
140142 let origin_dir = test_env. work_dir ( "origin" ) ;
141- let origin_git_repo_path = origin_dir
142- . root ( )
143- . join ( ".jj" )
144- . join ( "repo" )
145- . join ( "store" )
146- . join ( "git" ) ;
143+ test_env
144+ . run_jj_in ( "." , [ "git" , "init" , "--colocate" , "upstream" ] )
145+ . success ( ) ;
146+ let _upstream_dir = test_env. work_dir ( "upstream" ) ;
147147
148148 work_dir
149149 . run_jj ( [ "bookmark" , "create" , "-r@" , "aaa-local" ] )
@@ -154,13 +154,10 @@ fn test_bookmark_names() {
154154
155155 // add various remote branches
156156 work_dir
157- . run_jj ( [
158- "git" ,
159- "remote" ,
160- "add" ,
161- "origin" ,
162- origin_git_repo_path. to_str ( ) . unwrap ( ) ,
163- ] )
157+ . run_jj ( [ "git" , "remote" , "add" , "origin" , "../origin" ] )
158+ . success ( ) ;
159+ work_dir
160+ . run_jj ( [ "git" , "remote" , "add" , "upstream" , "../upstream" ] )
164161 . success ( ) ;
165162 work_dir
166163 . run_jj ( [ "bookmark" , "create" , "-r@" , "aaa-tracked" ] )
@@ -174,8 +171,18 @@ fn test_bookmark_names() {
174171 work_dir
175172 . run_jj ( [ "desc" , "-r" , "bbb-tracked" , "-m" , "x" ] )
176173 . success ( ) ;
174+
175+ work_dir
176+ . run_jj ( [ "bookmark" , "track" , "--remote=origin" , "glob:*-tracked" ] )
177+ . success ( ) ;
178+ work_dir
179+ . run_jj ( [ "bookmark" , "track" , "--remote=upstream" , "aaa-tracked" ] )
180+ . success ( ) ;
177181 work_dir
178- . run_jj ( [ "git" , "push" , "--allow-new" , "--bookmark" , "glob:*-tracked" ] )
182+ . run_jj ( [ "git" , "push" , "--remote=origin" , "--tracked" ] )
183+ . success ( ) ;
184+ work_dir
185+ . run_jj ( [ "git" , "push" , "--remote=upstream" , "--tracked" ] )
179186 . success ( ) ;
180187
181188 origin_dir
@@ -190,8 +197,20 @@ fn test_bookmark_names() {
190197 origin_dir
191198 . run_jj ( [ "desc" , "-r" , "bbb-untracked" , "-m" , "x" ] )
192199 . success ( ) ;
193- origin_dir. run_jj ( [ "git" , "export" ] ) . success ( ) ;
194- work_dir. run_jj ( [ "git" , "fetch" ] ) . success ( ) ;
200+ work_dir. run_jj ( [ "git" , "fetch" , "--all-remotes" ] ) . success ( ) ;
201+
202+ insta:: assert_snapshot!( work_dir. run_jj( [ "bookmark" , "list" , "--all" ] ) , @r"
203+ aaa-local: qpvuntsm fe38a82d (empty) x
204+ aaa-tracked: qpvuntsm fe38a82d (empty) x
205+ @origin: qpvuntsm fe38a82d (empty) x
206+ @upstream: qpvuntsm fe38a82d (empty) x
207+ aaa-untracked@origin: rlvkpnrz 434ae005 (empty) x
208+ bbb-local: qpvuntsm fe38a82d (empty) x
209+ bbb-tracked: qpvuntsm fe38a82d (empty) x
210+ @origin: qpvuntsm fe38a82d (empty) x
211+ bbb-untracked@origin: rlvkpnrz 434ae005 (empty) x
212+ [EOF]
213+ " ) ;
195214
196215 // Every shell hook is a little different, e.g. the zsh hooks add some
197216 // additional environment variables. But this is irrelevant for the purpose
@@ -264,14 +283,14 @@ fn test_bookmark_names() {
264283
265284 let output = work_dir. complete_fish ( [ "bookmark" , "track" , "a" ] ) ;
266285 insta:: assert_snapshot!( output, @r"
267- aaa-local@origin x
268- aaa-untracked@origin x
286+ aaa-local x
287+ aaa-untracked x
269288 [EOF]
270289 " ) ;
271290
272291 let output = work_dir. complete_fish ( [ "bookmark" , "untrack" , "a" ] ) ;
273292 insta:: assert_snapshot!( output, @r"
274- aaa-tracked@origin x
293+ aaa-tracked x
275294 [EOF]
276295 " ) ;
277296
0 commit comments