Skip to content

Commit

Permalink
feat(stash): added alternative branch download for stash
Browse files Browse the repository at this point in the history
  • Loading branch information
kkotula committed Feb 6, 2024
1 parent d13b2cd commit 7f738c8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/git/stash/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ func (f *FileService) Download(org, repo, path, branch string) (string, error) {
// It is not always clear which branch is the true master branch due to different naming conventions.
// Therefore, we will need to try one of them [main, master] to ensure we can access the necessary files.
var branchAlternatives = map[string]string{
"master": "main",
"main": "master",
"master": "main",
"refs/heads/master": "refs/heads/main",
"main": "master",
"refs/heads/main": "refs/heads/master",
}

if alternativeBranchName, ok := branchAlternatives[branch]; ok {
Expand Down

0 comments on commit 7f738c8

Please sign in to comment.