Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
HFTSoftwareProject
DTABackend
Commits
8aabe7e6
Commit
8aabe7e6
authored
Jan 30, 2024
by
Lückemeyer
Browse files
added solution idea comments for issue #8
parent
b80f7087
Pipeline
#9075
passed with stage
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
src/main/java/de/hftstuttgart/dtabackend/utils/JGitUtil.java
View file @
8aabe7e6
...
@@ -28,10 +28,25 @@ public class JGitUtil {
...
@@ -28,10 +28,25 @@ public class JGitUtil {
FileSystemUtils
.
deleteRecursively
(
targetDirectory
);
FileSystemUtils
.
deleteRecursively
(
targetDirectory
);
}
}
//create companion checkout dir "targetPath"+"_checkout"
File
checkoutDirectory
=
new
File
(
targetPath
+
"_checkout"
);
if
(
targetDirectory
.
exists
())
{
LOG
.
debug
(
"clone checkout directory existing yet, deleting now"
);
FileSystemUtils
.
deleteRecursively
(
checkoutDirectory
);
}
try
{
try
{
//check group(1) for possible directory
//if(!config.group(1).endsWith(".git"))
//cut off the directory part
//pos=instr(".git/")
//cloneURI=config.group(1).substr(1, pos+3)
//else
//cloneURI=config.group(1)
LOG
.
debug
(
"preparing clone"
);
LOG
.
debug
(
"preparing clone"
);
CloneCommand
cloneCommand
=
Git
.
cloneRepository
()
CloneCommand
cloneCommand
=
Git
.
cloneRepository
()
.
setDirectory
(
targetDirectory
)
.
setDirectory
(
checkoutDirectory
)
//.setURI(cloneURI)
.
setURI
(
config
.
group
(
1
));
.
setURI
(
config
.
group
(
1
));
if
(!
config
.
group
(
2
).
equals
(
"none"
)
&&
!
config
.
group
(
3
).
equals
(
"none"
))
{
if
(!
config
.
group
(
2
).
equals
(
"none"
)
&&
!
config
.
group
(
3
).
equals
(
"none"
))
{
...
@@ -43,6 +58,13 @@ public class JGitUtil {
...
@@ -43,6 +58,13 @@ public class JGitUtil {
LOG
.
debug
(
"cloning..."
);
LOG
.
debug
(
"cloning..."
);
cloneCommand
.
call
()
cloneCommand
.
call
()
.
close
();
.
close
();
//copy appropriate path from checkout directory to target directory
//if(!config.group(1).endsWith(".git"))
//copy checkout+config.group(1).substr(pos+4) to target directory
//else
//copy checkout directory to target directory directly
}
}
catch
(
GitAPIException
e
)
{
catch
(
GitAPIException
e
)
{
LOG
.
error
(
String
.
format
(
"Error while cloning from %s"
,
config
.
group
(
1
)),
e
);
LOG
.
error
(
String
.
format
(
"Error while cloning from %s"
,
config
.
group
(
1
)),
e
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment