-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from vicheanath/git-repo
Add Git Service
- Loading branch information
Showing
26 changed files
with
315 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -397,4 +397,4 @@ FodyWeavers.xsd | |
# JetBrains Rider | ||
*.sln.iml | ||
|
||
/SearchBugs.Api/repo/ | ||
src/SearchBugs.Api/repo/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/SearchBugs.Application/Git/DeleteGitRepo/DeleteGitRepoCommandHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/SearchBugs.Application/Git/GitHttpServer/GitHttpServerCommandHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace SearchBugs.Infrastructure.Services; | ||
|
||
public record Contributor | ||
{ | ||
public string Name { get; init; } | ||
public string Email { get; init; } | ||
public int CommitCount { get; init; } | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace SearchBugs.Infrastructure.Services; | ||
|
||
public record FileBlame | ||
{ | ||
public int LineNumber { get; init; } | ||
public string CommitSha { get; init; } | ||
public string Author { get; init; } | ||
public string Email { get; init; } | ||
public DateTime Date { get; init; } | ||
public int LineContent { get; init; } | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace SearchBugs.Domain.Git; | ||
|
||
public class FileChange | ||
{ | ||
public string FileName { get; set; } | ||
public string Status { get; set; } | ||
public int Additions { get; set; } | ||
public int Deletions { get; set; } | ||
|
||
public FileChange(string fileName, string status, int additions, int deletions) | ||
{ | ||
FileName = fileName; | ||
Status = status; | ||
Additions = additions; | ||
Deletions = deletions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace SearchBugs.Infrastructure.Services; | ||
|
||
public record FileDiff | ||
{ | ||
public string FilePath { get; init; } | ||
public string OldPath { get; init; } | ||
public string Status { get; init; } | ||
public string Patch { get; init; } | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Shared.Errors; | ||
|
||
namespace SearchBugs.Domain.Git; | ||
|
||
public static class GitErrors | ||
{ | ||
public static Error InvalidCommitPath = new Error("Git.InvalidCommitPath", "Invalid path or commit."); | ||
|
||
public static Error FileNotFound = new Error("Git.FileNotFound", "File not found."); | ||
|
||
public static Error BranchNotFound = new Error("Git.BranchNotFound", "Branch not found."); | ||
|
||
public static Error CommitNotFound = new Error("Git.CommitNotFound", "Commit not found."); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace SearchBugs.Infrastructure.Services; | ||
|
||
public record GitTreeItem | ||
{ | ||
public string Path { get; init; } | ||
public string Name { get; init; } | ||
public string Type { get; init; } | ||
} |
4 changes: 2 additions & 2 deletions
4
...chBugs.Domain/Repositories/IGitService.cs → src/SearchBugs.Domain/Git/IGitHttpService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
namespace SearchBugs.Domain.Repositories; | ||
namespace SearchBugs.Domain.Git; | ||
|
||
public interface IGitService | ||
public interface IGitHttpService | ||
{ | ||
Task Handle(string repositoryName, CancellationToken cancellationToken = default); | ||
} |
5 changes: 3 additions & 2 deletions
5
...ugs.Domain/Repositories/IGitRepository.cs → src/SearchBugs.Domain/Git/IGitRepository.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace SearchBugs.Domain.Git; | ||
|
||
public interface IGitRepositoryService | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace SearchBugs.Infrastructure.Services; | ||
|
||
|
||
public record MergeResult | ||
{ | ||
public string Status { get; init; } | ||
public string CommitSha { get; init; } | ||
} | ||
|
||
|
||
|
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/SearchBugs.Domain/Repositories/IGitRepositoryService.cs
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.