@@ -13,63 +13,71 @@ public interface GitContext extends IdeLogger {
13
13
* Checks if the Git repository in the specified target folder needs an update by inspecting the modification time of
14
14
* a magic file.
15
15
*
16
- * @param repoUrl the git remote URL to clone from. May be suffixed with a hash-sign ('#') followed by the branch name
17
- * to check-out.
16
+ * @param repoUrl the git remote URL to clone from.
18
17
* @param targetRepository the {@link Path} to the target folder where the git repository should be cloned or pulled.
19
- * It is not the parent directory where git will by default create a sub-folder by default on clone but the *
20
- * final folder that will contain the ".git" subfolder.
18
+ * It is not the parent directory where git will by default create a sub-folder by default on clone but the * final
19
+ * folder that will contain the ".git" subfolder.
21
20
*/
22
- void pullOrCloneIfNeeded (String repoUrl , Path targetRepository );
21
+ void pullOrCloneIfNeeded (String repoUrl , String branch , Path targetRepository );
23
22
24
23
/**
25
24
* Attempts a git pull and reset if required.
26
25
*
27
- * @param repoUrl the git remote URL to clone from. May be suffixed with a hash-sign ('#') followed by the branch name
28
- * to check-out .
26
+ * @param repoUrl the git remote URL to clone from.
27
+ * @param branch the branch name e.g. master .
29
28
* @param targetRepository the {@link Path} to the target folder where the git repository should be cloned or pulled.
30
- * It is not the parent directory where git will by default create a sub-folder by default on clone but the *
31
- * final folder that will contain the ".git" subfolder.
29
+ * It is not the parent directory where git will by default create a sub-folder by default on clone but the * final
30
+ * folder that will contain the ".git" subfolder.
32
31
* @param remoteName the remote name e.g. origin.
33
- * @param branchName the branch name e.g. master.
34
32
*/
35
- void pullOrFetchAndResetIfNeeded (String repoUrl , Path targetRepository , String remoteName , String branchName );
33
+ void pullOrFetchAndResetIfNeeded (String repoUrl , String branch , Path targetRepository , String remoteName );
36
34
37
35
/**
38
36
* Runs a git pull or a git clone.
39
37
*
40
- * @param gitRepoUrl the git remote URL to clone from. May be suffixed with a hash-sign ('#') followed by the branch
41
- * name to check-out.
38
+ * @param gitRepoUrl the git remote URL to clone from.
42
39
* @param targetRepository the {@link Path} to the target folder where the git repository should be cloned or pulled.
43
- * It is not the parent directory where git will by default create a sub-folder by default on clone but the *
44
- * final folder that will contain the ".git" subfolder.
40
+ * It is not the parent directory where git will by default create a sub-folder by default on clone but the * final
41
+ * folder that will contain the ".git" subfolder.
45
42
*/
46
43
void pullOrClone (String gitRepoUrl , Path targetRepository );
47
44
45
+ /**
46
+ * Runs a git pull or a git clone.
47
+ *
48
+ * @param gitRepoUrl the git remote URL to clone from.
49
+ * @param branch the branch name e.g. master.
50
+ * @param targetRepository the {@link Path} to the target folder where the git repository should be cloned or pulled.
51
+ * It is not the parent directory where git will by default create a sub-folder by default on clone but the * final
52
+ * folder that will contain the ".git" subfolder.
53
+ */
54
+ void pullOrClone (String gitRepoUrl , String branch , Path targetRepository );
55
+
48
56
/**
49
57
* Runs a git clone. Throws a CliException if in offline mode.
50
58
*
51
59
* @param gitRepoUrl the {@link GitUrl} to use for the repository URL.
52
60
* @param targetRepository the {@link Path} to the target folder where the git repository should be cloned or pulled.
53
- * It is not the parent directory where git will by default create a sub-folder by default on clone but the *
54
- * final folder that will contain the ".git" subfolder.
61
+ * It is not the parent directory where git will by default create a sub-folder by default on clone but the * final
62
+ * folder that will contain the ".git" subfolder.
55
63
*/
56
64
void clone (GitUrl gitRepoUrl , Path targetRepository );
57
65
58
66
/**
59
67
* Runs a git pull.
60
68
*
61
69
* @param targetRepository the {@link Path} to the target folder where the git repository should be cloned or pulled.
62
- * It is not the parent directory where git will by default create a sub-folder by default on clone but the *
63
- * final folder that will contain the ".git" subfolder.
70
+ * It is not the parent directory where git will by default create a sub-folder by default on clone but the * final
71
+ * folder that will contain the ".git" subfolder.
64
72
*/
65
73
void pull (Path targetRepository );
66
74
67
75
/**
68
76
* Runs a git reset if files were modified.
69
77
*
70
78
* @param targetRepository the {@link Path} to the target folder where the git repository should be cloned or pulled.
71
- * It is not the parent directory where git will by default create a sub-folder by default on clone but the *
72
- * final folder that will contain the ".git" subfolder.
79
+ * It is not the parent directory where git will by default create a sub-folder by default on clone but the * final
80
+ * folder that will contain the ".git" subfolder.
73
81
* @param remoteName the remote server name.
74
82
* @param branchName the name of the branch.
75
83
*/
@@ -79,8 +87,8 @@ public interface GitContext extends IdeLogger {
79
87
* Runs a git cleanup if untracked files were found.
80
88
*
81
89
* @param targetRepository the {@link Path} to the target folder where the git repository should be cloned or pulled.
82
- * It is not the parent directory where git will by default create a sub-folder by default on clone but the *
83
- * final folder that will contain the ".git" subfolder.
90
+ * It is not the parent directory where git will by default create a sub-folder by default on clone but the * final
91
+ * folder that will contain the ".git" subfolder.
84
92
*/
85
93
void cleanup (Path targetRepository );
86
94
0 commit comments