Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): add git remotes tab #397

Closed
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
06fae16
feat: browse local repositories
aymanbagabas Aug 21, 2023
bc6a9f2
refactor(ui): resolve race conditions and clean up code
aymanbagabas Oct 5, 2023
621cc08
feat(ui): update readme based on selected reference
aymanbagabas Oct 5, 2023
c96839e
feat(ui): add branch/tag commit date and hash
aymanbagabas Oct 5, 2023
8d467e4
fix(ui): clean up statusbar logic
aymanbagabas Oct 5, 2023
2291b83
fix(ui): cleanup statusbar and misc msgs
aymanbagabas Oct 6, 2023
76e67c2
fix(ui): preserve header line when no description is available
aymanbagabas Oct 6, 2023
8347335
feat(ui): add git remotes tab
emilaleksanteri Oct 8, 2023
dbf07c1
feat: browse local repositories
aymanbagabas Aug 21, 2023
aa289c5
refactor(ui): resolve race conditions and clean up code
aymanbagabas Oct 5, 2023
9a95c56
feat(ui): update readme based on selected reference
aymanbagabas Oct 5, 2023
2fcaf5f
feat(ui): add branch/tag commit date and hash
aymanbagabas Oct 5, 2023
b794f0b
fix(ui): clean up statusbar logic
aymanbagabas Oct 5, 2023
1aac737
fix(ui): cleanup statusbar and misc msgs
aymanbagabas Oct 6, 2023
4014bc0
fix(ui): preserve header line when no description is available
aymanbagabas Oct 6, 2023
b887ca6
fix(ui): match readme and list missing items styles
aymanbagabas Oct 16, 2023
4f65159
Merge branch 'browse' into emil/git-remotes-tab
emilaleksanteri Oct 16, 2023
8ac7310
Merge branch 'browse' into emil/git-remotes-tab
aymanbagabas Oct 23, 2023
a2b392f
Merge branch 'browse' into emil/git-remotes-tab
aymanbagabas Oct 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/soft/browse.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ var browseCmd = &cobra.Command{
repo.NewFiles(c),
repo.NewLog(c),
repo.NewRefs(c, git.RefsHeads),
repo.NewRefs(c, git.RefsRemotes),
repo.NewRefs(c, git.RefsTags),
),
repoPath: abs,
Expand Down
7 changes: 6 additions & 1 deletion git/reference.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
RefsHeads = git.RefsHeads
// RefsTags represents the prefix for tag references.
RefsTags = git.RefsTags
// RefsRemotes represents the prefix for remote references.
RefsRemotes = "refs/remotes/"

Check failure on line 17 in git/reference.go

View workflow job for this annotation

GitHub Actions / lint

File is not `goimports`-ed (goimports)
)

// Reference is a wrapper around git.Reference with helper methods.
Expand All @@ -31,6 +33,9 @@

// Short returns the short name of the reference i.e. master.
func (r ReferenceName) Short() string {
if (strings.HasPrefix(string(r), RefsRemotes)) {
return strings.TrimPrefix(string(r), RefsRemotes)
}

Check warning on line 38 in git/reference.go

View check run for this annotation

Codecov / codecov/patch

git/reference.go#L37-L38

Added lines #L37 - L38 were not covered by tests
return git.RefShortName(string(r))
}

Expand All @@ -41,7 +46,7 @@

// IsBranch returns true if the reference is a branch.
func (r *Reference) IsBranch() bool {
return strings.HasPrefix(r.Refspec, git.RefsHeads)
return strings.HasPrefix(r.Refspec, git.RefsHeads) || strings.HasPrefix(r.Refspec, RefsRemotes)

Check warning on line 49 in git/reference.go

View check run for this annotation

Codecov / codecov/patch

git/reference.go#L49

Added line #L49 was not covered by tests
}

// IsTag returns true if the reference is a tag.
Expand Down
2 changes: 2 additions & 0 deletions server/ui/pages/repo/refs.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
return "Branches"
} else if r.refPrefix == git.RefsTags {
return "Tags"
} else if r.refPrefix == git.RefsRemotes {
return "Remotes"

Check warning on line 67 in server/ui/pages/repo/refs.go

View check run for this annotation

Codecov / codecov/patch

server/ui/pages/repo/refs.go#L67

Added line #L67 was not covered by tests
} else {
return "Refs"
}
Expand Down
Loading