@@ -11,13 +11,10 @@ import { nativeGetBranchNames } from "../native-git/branch";
1111import { modifyLines } from "../humanOp" ;
1212
1313import { setupRemoteRepo } from "./util/setupRemoteRepo" ;
14- import { noop } from "../util/noop" ;
1514
1615export default async function run ( ) {
1716 await auto_checks_out_remote_partial_branches ( ) ;
18- //noop(auto_checks_out_remote_partial_branches)
19- noop ( give_chosen_name_to_local_branch )
20- //await give_chosen_name_to_local_branch();
17+ await give_chosen_name_to_local_branch ( ) ;
2118}
2219
2320async function auto_checks_out_remote_partial_branches ( ) {
@@ -71,22 +68,27 @@ async function give_chosen_name_to_local_branch() {
7168 */
7269 LocalBob . execSyncInRepo ( `git checkout ${ RemoteAlice . latestStackedBranchName } ` ) ;
7370
74- const remotePartialBranchesInAlice : string [ ] = RemoteAlice . partialBranches . map ( ( b ) => b . shorthand ( ) ) ;
75- const localPartialBranchesInBobBefore : string [ ] = findPartialBranchesThatArePresentLocally ( ) ;
71+ const renamedLocalBranch = "partial-renamed-local-branch-hehe" as const ;
7672
77- function findPartialBranchesThatArePresentLocally (
78- localBranches : string [ ] = nativeGetBranchNames ( LocalBob . repo . workdir ( ) ) ( "local" )
79- ) {
80- return remotePartialBranchesInAlice . filter ( ( partial ) => localBranches . includes ( partial ) ) ;
73+ const isPartial = ( b : string ) : boolean => b . includes ( "partial" )
74+
75+ assert ( isPartial ( renamedLocalBranch ) )
76+
77+ // TODO TS
78+ // @ts -ignore
79+ const remotePartialBranchesInAlice : string [ ] = findPartialBranches ( RemoteAlice ) ;
80+ const localPartialBranchesInBobBefore : string [ ] = findPartialBranches ( LocalBob )
81+
82+ // TODO CLEANUP PREV TEST TOO
83+ function findPartialBranches ( owner : typeof RemoteAlice | typeof LocalBob , workdir = owner . repo . workdir ( ) ) : string [ ] {
84+ return nativeGetBranchNames ( workdir ) ( "local" ) . filter ( isPartial )
8185 }
8286
8387 assert . deepStrictEqual (
8488 localPartialBranchesInBobBefore . length ,
8589 0 ,
8690 "expected partial branches to __not be__ checked out locally, to be able to test later that they will be."
8791 ) ;
88-
89- const renamedLocalBranch = "renamed-local-branch-hehe" as const ;
9092
9193 await gitStackedRebase ( RemoteAlice . initialBranch , {
9294 gitDir : LocalBob . repo . workdir ( ) ,
@@ -112,7 +114,7 @@ async function give_chosen_name_to_local_branch() {
112114 } ,
113115 } ) ;
114116
115- const localPartialBranchesInBobAfter : string [ ] = findPartialBranchesThatArePresentLocally ( ) ;
117+ const localPartialBranchesInBobAfter : string [ ] = findPartialBranches ( LocalBob )
116118
117119 console . log ( {
118120 remotePartialBranchesInAlice,
0 commit comments