Skip to content

Commit

Permalink
Fix conditions when GitStats set to scan whole hosts.
Browse files Browse the repository at this point in the history
  • Loading branch information
maciekbanas committed Jan 20, 2025
1 parent bec14ff commit 40cdf6e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# GitStats (development version)

- Fixed pulling repositories by code when `GitStats` is set to scan whole hosts ([#583](https://github.com/r-world-devs/GitStats/issues/583)).

# GitStats 2.2.0

This release brings some substantial improvements with making it possible to scan whole organizations and particular repositories for one host at the same time, boosting function to prepare commits statistics and simplifying workflow for getting files.
Expand Down
5 changes: 2 additions & 3 deletions R/EngineRestGitHub.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ EngineRestGitHub <- R6::R6Class(
output = "table_full",
verbose = TRUE,
progress = TRUE) {
if (!is.null(org)) {
if (is.null(repos)) {
search_result <- private$search_for_code(
code = code,
org = org,
Expand All @@ -64,8 +64,7 @@ EngineRestGitHub <- R6::R6Class(
verbose = verbose,
progress = progress
)
}
if (!is.null(repos)) {
} else {
search_result <- private$search_repos_for_code(
code = code,
repos = repos,
Expand Down
8 changes: 5 additions & 3 deletions R/EngineRestGitLab.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,17 @@ EngineRestGitLab <- R6::R6Class(
verbose = TRUE,
progress = TRUE) {
if (!is.null(org)) {
org <- utils::URLencode(org, reserved = TRUE)
}
if (is.null(repos)) {
search_response <- private$search_for_code(
code = code,
filename = filename,
in_path = in_path,
org = utils::URLencode(org, reserved = TRUE),
org = org,
verbose = verbose
)
}
if (!is.null(repos)) {
} else {
search_response <- private$search_repos_for_code(
code = code,
filename = filename,
Expand Down

0 comments on commit 40cdf6e

Please sign in to comment.