Skip to content

Commit

Permalink
internal/civisibility: trying to fix a filter issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyredondo committed Oct 14, 2024
1 parent ba203aa commit afee72f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/civisibility/utils/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func UnshallowGitRepository() (bool, error) {
// let's fetch the missing commits and trees from the last month
// git fetch --shallow-since="1 month ago" --update-shallow --filter="blob:none" --recurse-submodules=no $(git config --default origin --get clone.defaultRemoteName) $(git rev-parse HEAD)
log.Debug("civisibility.unshallow: fetching the missing commits and trees from the last month")
fetchOutput, err := execGitString("fetch", "--shallow-since=\"1 month ago\"", "--update-shallow", "--filter=\"blob:none\"", "--recurse-submodules=no", originName, headSha)
fetchOutput, err := execGitString("fetch", "--shallow-since=\"1 month ago\"", "--update-shallow", "--filter=blob:none", "--recurse-submodules=no", originName, headSha)

// let's check if the last command was unsuccessful
if err != nil || fetchOutput == "" {
Expand All @@ -233,7 +233,7 @@ func UnshallowGitRepository() (bool, error) {
if err == nil {
// let's try the alternative: git fetch --shallow-since="1 month ago" --update-shallow --filter="blob:none" --recurse-submodules=no $(git config --default origin --get clone.defaultRemoteName) $(git rev-parse --abbrev-ref --symbolic-full-name @{upstream})
log.Debug("civisibility.unshallow: fetching the missing commits and trees from the last month using the remote branch name")
fetchOutput, err = execGitString("fetch", "--shallow-since=\"1 month ago\"", "--update-shallow", "--filter=\"blob:none\"", "--recurse-submodules=no", originName, remoteBranchName)
fetchOutput, err = execGitString("fetch", "--shallow-since=\"1 month ago\"", "--update-shallow", "--filter=blob:none", "--recurse-submodules=no", originName, remoteBranchName)
}
}

Expand All @@ -248,7 +248,7 @@ func UnshallowGitRepository() (bool, error) {

// let's try the last fallback: git fetch --shallow-since="1 month ago" --update-shallow --filter="blob:none" --recurse-submodules=no $(git config --default origin --get clone.defaultRemoteName)
log.Debug("civisibility.unshallow: fetching the missing commits and trees from the last month using the origin name")
fetchOutput, err = execGitString("fetch", "--shallow-since=\"1 month ago\"", "--update-shallow", "--filter=\"blob:none\"", "--recurse-submodules=no", originName)
fetchOutput, err = execGitString("fetch", "--shallow-since=\"1 month ago\"", "--update-shallow", "--filter=blob:none", "--recurse-submodules=no", originName)
}

if err != nil {
Expand Down

0 comments on commit afee72f

Please sign in to comment.