3
3
import java .io .File ;
4
4
import java .io .FileWriter ;
5
5
import java .io .IOException ;
6
- import java .io .InputStream ;
7
6
import java .net .InetSocketAddress ;
8
7
import java .net .Proxy ;
9
8
import java .net .Proxy .Type ;
21
20
import org .eclipse .jgit .api .MergeResult ;
22
21
import org .eclipse .jgit .api .ResetCommand .ResetType ;
23
22
import org .eclipse .jgit .api .errors .GitAPIException ;
24
- import org .eclipse .jgit .lib .Constants ;
25
- import org .eclipse .jgit .lib .ObjectId ;
26
- import org .eclipse .jgit .lib .ObjectLoader ;
27
23
import org .eclipse .jgit .lib .Repository ;
28
- import org .eclipse .jgit .revwalk .RevCommit ;
29
- import org .eclipse .jgit .revwalk .RevTree ;
30
- import org .eclipse .jgit .revwalk .RevWalk ;
31
24
import org .eclipse .jgit .storage .file .FileRepositoryBuilder ;
32
25
import org .eclipse .jgit .transport .CredentialsProvider ;
33
26
import org .eclipse .jgit .transport .RefSpec ;
34
27
import org .eclipse .jgit .transport .UsernamePasswordCredentialsProvider ;
35
- import org .eclipse .jgit .treewalk .TreeWalk ;
36
- import org .eclipse .jgit .treewalk .filter .PathFilter ;
37
28
38
29
import com .projectkaiser .scm .vcs .api .AbstractVCS ;
39
30
import com .projectkaiser .scm .vcs .api .IVCS ;
@@ -69,7 +60,6 @@ public void createBranch(String srcBranchName, String newBranchName, String comm
69
60
git
70
61
.branchCreate ()
71
62
.setName (newBranchName )
72
- .setForce (true )
73
63
.setUpstreamMode (CreateBranchCommand .SetupUpstreamMode .SET_UPSTREAM )
74
64
.setStartPoint ("origin/" + srcBranchName )
75
65
.call ();
@@ -107,7 +97,6 @@ public void deleteBranch(String branchName, String commitMessage) {
107
97
git
108
98
.branchDelete ()
109
99
.setBranchNames (branchName )
110
- .setForce (true )
111
100
.call ();
112
101
113
102
git
@@ -121,7 +110,6 @@ public void deleteBranch(String branchName, String commitMessage) {
121
110
git
122
111
.push ()
123
112
.setPushAll ()
124
- .setForce (true )
125
113
.setRefSpecs (refSpec )
126
114
.setRemote ("origin" )
127
115
.setCredentialsProvider (credentials )
@@ -160,8 +148,6 @@ public Git getLocalGit(VCSWorkspace workspace) {
160
148
.setDirectory (workspace .getFolder ())
161
149
.setURI (baseUrl )
162
150
.setCredentialsProvider (credentials )
163
- .setBranch ("refs/heads/master" )
164
- //.setCloneAllBranches(true)
165
151
.setNoCheckout (true )
166
152
.call ();
167
153
} catch (GitAPIException e ) {
@@ -211,7 +197,7 @@ public PKVCSMergeResult merge(String sourceBranchUrl, String destBranchUrl, Stri
211
197
.setMode (ResetType .HARD )
212
198
.call ();
213
199
} catch (Exception e ) {
214
- workspace .setIsCorrupt (true );
200
+ workspace .setCorrupt (true );
215
201
}
216
202
} else {
217
203
git
@@ -239,10 +225,7 @@ private void checkout(String destBranchUrl, Git git) throws GitAPIException {
239
225
git
240
226
.checkout ()
241
227
.setCreateBranch (false )
242
- .setForce (true )
243
228
.setName (destBranchUrl )
244
- //.setStartPoint("origin/" + destBranchUrl)
245
- .setUpstreamMode (CreateBranchCommand .SetupUpstreamMode .SET_UPSTREAM )
246
229
.call ();
247
230
}
248
231
@@ -297,11 +280,8 @@ public String getFileContent(String branchName, String filePath, String encoding
297
280
git
298
281
.checkout ()
299
282
.setCreateBranch (false )
300
- .setForce (true )
301
283
.addPath (filePath )
302
284
.setName (branchName )
303
- //.setStartPoint("origin/" + destBranchUrl)
304
- //.setUpstreamMode(CreateBranchCommand.SetupUpstreamMode.SET_UPSTREAM)
305
285
.call ();
306
286
File file = new File (workspace .getFolder (), filePath );
307
287
@@ -333,11 +313,8 @@ public void setFileContent(String branchName, String filePath, String content, S
333
313
git
334
314
.checkout ()
335
315
.setCreateBranch (false )
336
- .setForce (true )
337
316
.addPath (filePath )
338
317
.setName (branchName )
339
- //.setStartPoint("origin/" + destBranchUrl)
340
- //.setUpstreamMode(CreateBranchCommand.SetupUpstreamMode.SET_UPSTREAM)
341
318
.call ();
342
319
343
320
File file = new File (workspace .getFolder (), filePath );
@@ -355,7 +332,6 @@ public void setFileContent(String branchName, String filePath, String content, S
355
332
356
333
git
357
334
.push ()
358
- .setForce (true )
359
335
.setRefSpecs (refSpec )
360
336
.setRemote ("origin" )
361
337
.setCredentialsProvider (credentials )
0 commit comments