@@ -19,34 +19,17 @@ const gitService = {
19
19
"gitInitResponse"
20
20
) ;
21
21
} ,
22
- /**
23
- * Clones a Git repository from the given URL to the specified path.
24
- * @param {string } url - The URL of the Git repository to clone.
25
- * @param {string } path - The file system path where the repository should be cloned to.
26
- * @returns {Promise<any> } A promise that resolves with the response from the clone event.
27
- */
28
- clone : async ( url : string , path : string ) : Promise < any > => {
29
- return cbws . messageManager . sendAndWaitForResponse (
30
- {
31
- "type" : "gitEvent" ,
32
- "action" : "Clone" ,
33
- "url" : url ,
34
- "path" : path
35
- } ,
36
- "CloneResponse"
37
- ) ;
38
- } ,
22
+
39
23
/**
40
24
* Pulls the latest changes from the remote repository to the local repository at the given path.
41
25
* @param {string } path - The file system path of the local Git repository.
42
26
* @returns {Promise<any> } A promise that resolves with the response from the pull event.
43
27
*/
44
- pull : async ( path : string ) : Promise < any > => {
28
+ pull : async ( ) : Promise < any > => {
45
29
return cbws . messageManager . sendAndWaitForResponse (
46
30
{
47
31
"type" : "gitEvent" ,
48
- "action" : "Pull" ,
49
- "path" : path
32
+ "action" : "Pull"
50
33
} ,
51
34
"PullResponse"
52
35
) ;
@@ -56,12 +39,12 @@ const gitService = {
56
39
* @param {string } path - The file system path of the local Git repository.
57
40
* @returns {Promise<any> } A promise that resolves with the response from the push event.
58
41
*/
59
- push : async ( path : string ) : Promise < any > => {
42
+ push : async ( ) : Promise < any > => {
60
43
return cbws . messageManager . sendAndWaitForResponse (
61
44
{
62
45
"type" : "gitEvent" ,
63
46
"action" : "Push" ,
64
- "path" : path
47
+
65
48
} ,
66
49
"PushResponse"
67
50
) ;
@@ -71,12 +54,11 @@ const gitService = {
71
54
* @param {string } path - The file system path of the local Git repository.
72
55
* @returns {Promise<any> } A promise that resolves with the response from the status event.
73
56
*/
74
- status : async ( path : string ) : Promise < any > => {
57
+ status : async ( ) : Promise < any > => {
75
58
return cbws . messageManager . sendAndWaitForResponse (
76
59
{
77
60
"type" : "gitEvent" ,
78
61
"action" : "Status" ,
79
- "path" : path
80
62
} ,
81
63
"gitStatusResponse"
82
64
) ;
@@ -86,12 +68,11 @@ const gitService = {
86
68
* @param {string } path - The file system path of the local Git repository.
87
69
* @returns {Promise<any> } A promise that resolves with the response from the add event.
88
70
*/
89
- add : async ( path : string ) : Promise < any > => {
71
+ addAll : async ( ) : Promise < any > => {
90
72
return cbws . messageManager . sendAndWaitForResponse (
91
73
{
92
74
"type" : "gitEvent" ,
93
75
"action" : "Add" ,
94
- "path" : path
95
76
} ,
96
77
"AddResponse"
97
78
) ;
@@ -117,15 +98,14 @@ const gitService = {
117
98
* @param {string } branch - The name of the branch or commit to check out.
118
99
* @returns {Promise<any> } A promise that resolves with the response from the checkout event.
119
100
*/
120
- checkout : async ( path : string , branch : string ) : Promise < any > => {
101
+ checkout : async ( branch : string ) : Promise < any > => {
121
102
return cbws . messageManager . sendAndWaitForResponse (
122
103
{
123
104
"type" : "gitEvent" ,
124
105
"action" : "Checkout" ,
125
- "path" : path ,
126
106
"branch" : branch
127
107
} ,
128
- "CheckoutResponse "
108
+ "gitCheckoutResponse "
129
109
) ;
130
110
} ,
131
111
/**
@@ -134,15 +114,14 @@ const gitService = {
134
114
* @param {string } branch - The name of the new branch to create.
135
115
* @returns {Promise<any> } A promise that resolves with the response from the branch event.
136
116
*/
137
- branch : async ( path : string , branch : string ) : Promise < any > => {
117
+ branch : async ( branch : string ) : Promise < any > => {
138
118
return cbws . messageManager . sendAndWaitForResponse (
139
119
{
140
120
"type" : "gitEvent" ,
141
- "action" : "Branch" ,
142
- "path" : path ,
143
- "branch" : branch
121
+ "action" : "gitBranch" ,
122
+ "branch" : branch ,
144
123
} ,
145
- "BranchResponse "
124
+ "gitBranchResponse "
146
125
) ;
147
126
} ,
148
127
/**
@@ -154,7 +133,7 @@ const gitService = {
154
133
return cbws . messageManager . sendAndWaitForResponse (
155
134
{
156
135
"type" : "gitEvent" ,
157
- "action" : "Logs " ,
136
+ "action" : "gitLogs " ,
158
137
"path" : path
159
138
} ,
160
139
"gitLogsResponse"
@@ -166,12 +145,11 @@ const gitService = {
166
145
* @param {string } path - The file system path of the local Git repository.
167
146
* @returns {Promise<any> } A promise that resolves with the response from the diff event.
168
147
*/
169
- diff : async ( commitHash : string , path : string ) : Promise < any > => {
148
+ diff : async ( commitHash : string ) : Promise < any > => {
170
149
return cbws . messageManager . sendAndWaitForResponse (
171
150
{
172
151
"type" : "gitEvent" ,
173
152
"action" : "Diff" ,
174
- "path" : path ,
175
153
"commitHash" : commitHash
176
154
} ,
177
155
"DiffResponse"
0 commit comments