Skip to content

Tracked remote#2700

Merged
technoweenie merged 17 commits intomasterfrom
tracked-remote
Oct 30, 2017
Merged

Tracked remote#2700
technoweenie merged 17 commits intomasterfrom
tracked-remote

Conversation

@technoweenie
Copy link
Contributor

@technoweenie technoweenie commented Oct 27, 2017

This teaches *config.Configuration how to get the default remote.

  1. The CurrentRemote property was replaced with Remote() string and SetRemote(string)
  2. Behavior from git.DefaultRemote() was replicated in Remote().
  3. All traces of git.DefaultRemote() were removed.

Fixes #2169.

EDIT: 1 caveat: this does not work with an empty repository, since git rev-parse blows up:

git-lfs/git/git.go

Lines 195 to 200 in bee3e75

func ResolveRef(ref string) (*Ref, error) {
outp, err := gitNoLFSSimple("rev-parse", ref, "--symbolic-full-name", ref)
if err != nil {
return nil, fmt.Errorf("Git can't resolve ref: %q", ref)
}
if outp == "" {

Not sure if this should assume any default branch name. Maybe it could look for any branch.*.remote config keys? Or this could just require a repository with at least 1 commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant