-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
52 additions
and
24 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
Binary file not shown.
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 |
---|---|---|
|
@@ -70,6 +70,31 @@ func TestGetGitContext(t *testing.T) { | |
LastCommitAuthor: "attiasas", | ||
}, | ||
}, | ||
{ | ||
name: "Gerrit Project (no owner)", | ||
testProjectZipDirPath: filepath.Join(basePath, "gerrit"), | ||
gitInfo: &services.XscGitInfoContext{ | ||
GitRepoHttpsCloneUrl: "https://gerrit.googlesource.com/git-repo", | ||
GitRepoName: "git-repo", | ||
GitProject: "git-repo", | ||
GitProvider: "gerrit", | ||
BranchName: "main", | ||
LastCommitHash: "1711bc23c0ab6ff4a51bf948c703c81073dd3475", | ||
LastCommitMessage: `git_config: prefer XDG config location | ||
Currently, repo ignores the XDG path for the git config file, and | ||
creates a new one in the user's home directory. This commit changes the | ||
behavior to prefer the XDG path if it exists, which matches git behavior | ||
and avoids littering the home directory. | ||
Bug: 40012443 | ||
Change-Id: Icd3ec6db6b0832f47417bbe98ff9461306b51297 | ||
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/448385 | ||
Tested-by: lmaor xenix <[email protected]> | ||
Reviewed-by: Mike Frysinger <[email protected]>`, | ||
LastCommitAuthor: "flexagoon", | ||
}, | ||
}, | ||
{ | ||
name: "Forked Project (multiple remotes)", | ||
testProjectZipDirPath: filepath.Join(basePath, "forked"), | ||
|
@@ -161,6 +186,11 @@ func TestGetGitProvider(t *testing.T) { | |
url: "https://dev.azure.com/attiasas/test-security-git/_git/test-security-git", | ||
provider: Azure, | ||
}, | ||
{ | ||
name: "Gerrit", | ||
url: "https://gerrit.googlesource.com/git-repo", | ||
provider: Gerrit, | ||
}, | ||
{ | ||
name: "Unknown", | ||
url: "ssh://[email protected]/assafa/test-security-git.git", | ||
|
@@ -202,6 +232,11 @@ func TestGetGitProject(t *testing.T) { | |
url: "ssh://[email protected]/~assafa/test-security-git.git", | ||
project: "~assafa", | ||
}, | ||
{ | ||
name: "Gerrit - No project name", | ||
url: "https://gerrit.googlesource.com/git-repo", | ||
project: "git-repo", | ||
}, | ||
} | ||
for _, testCase := range testCases { | ||
t.Run(testCase.name, func(t *testing.T) { | ||
|
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