File tree Expand file tree Collapse file tree 2 files changed +20
-14
lines changed
Expand file tree Collapse file tree 2 files changed +20
-14
lines changed Original file line number Diff line number Diff line change 1313
1414SetWorkTree('git- test- background - hook')
1515
16- SetWorkingDir (EnvGet ('TEMP'))
17- Info 'uname: ' RunWaitOne('uname - a')
18- Info RunWaitOne('git version -- build- options')
19-
20- RunWait ('git init " ' workTree '" ', '', 'Hide ')
21- if A_LastError
22- ExitWithError 'Could not initialize Git worktree at: ' workTree
23-
24- SetWorkingDir (workTree)
25- if A_LastError
26- ExitWithError 'Could not set working directory to: ' workTree
27-
2816if not FileExist ('.git/ hooks') and not DirCreate('.git/ hooks')
2917 ExitWithError 'Could not create hooks directory: ' workTree
3018
@@ -70,5 +58,4 @@ Info('Match!')
7058Send ('^ C')
7159Send ('exit{Enter }')
7260Sleep 50
73- SetWorkingDir (EnvGet ('TEMP'))
74- DirDelete(workTree, true )
61+ CleanUpWorkTree()
Original file line number Diff line number Diff line change @@ -18,6 +18,25 @@ SetWorkTree(defaultName) {
1818 workTree := workTree '- ' counter
1919 }
2020 }
21+
22+ SetWorkingDir (EnvGet ('TEMP'))
23+ Info 'uname: ' RunWaitOne('uname - a')
24+ Info RunWaitOne('git version -- build- options')
25+
26+ RunWait ('git init " ' workTree '" ', '', 'Hide ')
27+ if A_LastError
28+ ExitWithError 'Could not initialize Git worktree at: ' workTree
29+
30+ SetWorkingDir (workTree)
31+ if A_LastError
32+ ExitWithError 'Could not set working directory to: ' workTree
33+ }
34+
35+ CleanUpWorkTree () {
36+ global workTree
37+ SetWorkingDir (EnvGet ('TEMP'))
38+ Info 'Cleaning up worktree: ' workTree
39+ DirDelete(workTree, true )
2140}
2241
2342Info (text ) {
You can’t perform that action at this time.
0 commit comments