Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4966fec

Browse filesBrowse files
committed
Readme update
1 parent 8320dd2 commit 4966fec
Copy full SHA for 4966fec

File tree

4 files changed

+31
-7
lines changed
Filter options

4 files changed

+31
-7
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+13-2Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/d14142d5d6f04ba891d505e2e47b417d)](https://www.codacy.com/gh/kawansoft/SympleGit-Java?utm_source=github.com&utm_medium=referral&utm_content=kawansoft/SympleGit-Java&utm_campaign=Badge_Grade)
66
![GitHub contributors](https://img.shields.io/github/contributors/kawansoft/SympleGit-Java)
77

8-
# SympleGit v1.0 - January 19, 2024
8+
# SympleGit v1.1 - September 19, 2024
99

1010
<img src="https://www.symplegit.com/img/arrow_fork2.png" />
1111

@@ -24,6 +24,7 @@ Table of Contents
2424
* [The GitCommander API](#the-gitcommander-api)
2525
* [Short Output](#short-output)
2626
* [Large Output](#large-output)
27+
* [Setting a Custom Git Executable](#setting-a-custom-git-executable)
2728
* [Setting a Timeout](#setting-a-timeout)
2829
* [Releasing Resources by Closing the SympleGit Instance](#releasing-resources-by-closing-the-symplegit-instance)
2930
* [The Facilitator API](#the-facilitator-api)
@@ -58,7 +59,7 @@ SympleGit requires Java version 11 or newer.
5859
```xml
5960
<groupId>com.symplegit</groupId>
6061
<artifactId>symplegit</artifactId>
61-
<version>1.0</version>
62+
<version>1.1</version>
6263
```
6364

6465
## Why Choose SympleGit Over JGit?
@@ -223,6 +224,16 @@ if (gitCommander.getSize() <= 1 * 1024 * 1024) {
223224
}
224225
```
225226

227+
### Setting a Custom Git Executable
228+
229+
To enhance flexibility and ensure compatibility across various environments, SympleGit provides the option to specify a custom path for the Git executable. This feature is particularly useful if the default Git installation path is not in your system's `PATH` environment variable, or if you wish to use a specific version of Git.
230+
231+
```java
232+
final Git sympleGit = SympleGit.custom()
233+
.setGitExecutable("/usr/local/bin/git") // Specify the full path to the Git executable
234+
.build();
235+
```
236+
226237
### Setting a Timeout
227238

228239
SympleGit enables setting a timeout for the Git process with `Builder.setTimeout`:

‎pom.xml

Copy file name to clipboardExpand all lines: pom.xml
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
<groupId>com.symplegit</groupId>
55
<artifactId>symplegit</artifactId>
6-
<version>1.0</version>
6+
<version>1.1</version>
7+
78
<dependencies>
89
<dependency>
910
<groupId>commons-io</groupId>

‎src/test/java/com/symplegit/examples/misc/GitBranchTest.java

Copy file name to clipboardExpand all lines: src/test/java/com/symplegit/examples/misc/GitBranchTest.java
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public static void main(String[] args) throws IOException {
3838
String repoDirectoryPath = "I:\\_dev_sqlephant_tests\\Java";
3939

4040
final SympleGit sympleGit = SympleGit.custom()
41+
.setGitExecutable("\\toto\\git.exe")
4142
.setDirectory(repoDirectoryPath)
4243
.build();
4344

‎src/test/java/com/symplegit/unit/test/GitVersionTest.java

Copy file name to clipboardExpand all lines: src/test/java/com/symplegit/unit/test/GitVersionTest.java
+15-4Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,34 @@
2424
import java.io.File;
2525
import java.io.IOException;
2626

27+
import org.apache.commons.lang3.SystemUtils;
2728
import org.junit.jupiter.api.BeforeEach;
2829
import org.junit.jupiter.api.Test;
2930

3031
import com.symplegit.api.SympleGit;
32+
import com.symplegit.api.SympleGit.Builder;
3133
import com.symplegit.api.facilitator.GitVersion;
3234
import com.symplegit.test.util.GitTestUtils;
3335

3436
public class GitVersionTest {
3537

3638
private GitVersion gitVersion;
3739
private File repoDir;
38-
40+
private SympleGit sympleGit;
41+
3942
@BeforeEach
4043
public void setUp() throws IOException {
4144
// Create a temporary Git repository
4245
repoDir = GitTestUtils.createIfNotTexistsTemporaryGitRepo();
43-
final SympleGit sympleGit = SympleGit.custom()
44-
.setDirectory(repoDir)
45-
.build();
46+
47+
Builder builder = SympleGit.custom();
48+
builder.setDirectory(repoDir);
49+
50+
if (SystemUtils.IS_OS_WINDOWS) {
51+
builder.setGitExecutable("C:\\Program Files\\Git\\bin\\git.exe");
52+
}
53+
54+
sympleGit= builder.build();
4655
gitVersion = new GitVersion(sympleGit);
4756
}
4857

@@ -54,5 +63,7 @@ public void testGetVersion() throws IOException {
5463
// Check that the returned version string is not null and contains expected content
5564
assertNotNull(gitVersion, "Git version should not be null");
5665
assert(gitVersion.contains("git version"));
66+
System.out.println("Git executable: " + sympleGit.getGitExecutable());
67+
System.out.println("Git version : " + gitVersion);
5768
}
5869
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.