Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
ddit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jack MacLauchlan CS2015
ddit
Commits
3fb10635
Commit
3fb10635
authored
6 years ago
by
Jack MacLauchlan CS2015
Browse files
Options
Downloads
Patches
Plain Diff
update works properly
parent
bf8b0f2d
No related branches found
No related tags found
1 merge request
!2
Commit tree
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
questions
+0
-6
0 additions, 6 deletions
questions
src/main/java/command/CommandUpdate.java
+1
-1
1 addition, 1 deletion
src/main/java/command/CommandUpdate.java
src/main/java/git/IssueRepo.java
+21
-5
21 additions, 5 deletions
src/main/java/git/IssueRepo.java
with
22 additions
and
12 deletions
questions
+
0
−
6
View file @
3fb10635
problems learning how to build tree
line endings - possibly not the issue
index not updating
how should push and merge work
empty index
when conflict in comments warn user that someone doing something bad
edit comments
...
...
This diff is collapsed.
Click to expand it.
src/main/java/command/CommandUpdate.java
+
1
−
1
View file @
3fb10635
...
...
@@ -54,7 +54,7 @@ public class CommandUpdate implements Command {
}
if
(
commitMessage
!=
null
)
{
try
{
repo
.
wri
teIssue
(
issue
,
commitMessage
);
repo
.
upda
teIssue
s
(
issue
,
commitMessage
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/git/IssueRepo.java
+
21
−
5
View file @
3fb10635
...
...
@@ -7,18 +7,14 @@ import org.eclipse.jgit.api.MergeCommand;
import
org.eclipse.jgit.api.MergeResult
;
import
org.eclipse.jgit.api.ResetCommand
;
import
org.eclipse.jgit.api.errors.GitAPIException
;
import
org.eclipse.jgit.dircache.DirCache
;
import
org.eclipse.jgit.lib.*
;
import
org.eclipse.jgit.merge.MergeStrategy
;
import
org.eclipse.jgit.merge.Merger
;
import
org.eclipse.jgit.revwalk.RevCommit
;
import
org.eclipse.jgit.revwalk.RevTree
;
import
org.eclipse.jgit.revwalk.RevWalk
;
import
org.eclipse.jgit.storage.file.FileRepositoryBuilder
;
import
org.eclipse.jgit.transport.PushResult
;
import
org.eclipse.jgit.transport.RefSpec
;
import
org.eclipse.jgit.treewalk.AbstractTreeIterator
;
import
org.eclipse.jgit.treewalk.TreeWalk
;
import
java.awt.*
;
import
java.io.File
;
...
...
@@ -199,7 +195,6 @@ public class IssueRepo {
}
}
public
void
writeIssue
(
Issue
issue
,
String
commitMessage
)
throws
IOException
{
RevCommit
currentCommit
=
getCurrentCommit
();
...
...
@@ -220,6 +215,27 @@ public class IssueRepo {
}
public
void
updateIssues
(
Issue
issue
,
String
commitMessage
)
throws
IOException
{
RevCommit
currentCommit
=
getCurrentCommit
();
IssueTreeBuilder
issueWriter
=
new
IssueTreeBuilder
(
repository
);
issueWriter
.
buildIssueTree
(
issue
);
List
<
Issue
>
sortedIssues
=
getIssues
();
sortedIssues
.
sort
(
Comparator
.
comparing
(
Issue:
:
getOriginalHash
));
int
i
=
sortedIssues
.
indexOf
(
issue
);
sortedIssues
.
remove
(
i
);
sortedIssues
.
add
(
i
,
issue
);
TreeFormatter
repoTreeFormatter
=
new
TreeFormatter
();
getTree
(
sortedIssues
,
repoTreeFormatter
,
issueWriter
);
ObjectId
repoTree
=
oi
.
insert
(
Constants
.
OBJ_TREE
,
repoTreeFormatter
.
toByteArray
());
commit
(
commitMessage
,
repoTree
,
currentCommit
);
}
public
void
deleteIssue
(
String
hash
)
throws
IOException
{
RevCommit
currentCommit
=
getCurrentCommit
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment