From 45846c2f0520d95d7300becfed7f650363c89dee Mon Sep 17 00:00:00 2001 From: Taylor Blau Date: Tue, 25 Sep 2018 14:36:14 -0700 Subject: [PATCH] commands/command_migrate.go: use formatRefName to qualify references Per our work in the previous commit(s), it is now suitable to call formatRefName() again thus avoiding our "hack" to prepend the remote name to the reference before calling '(*git.Ref) Refspec()'. As such, let's do that. Co-authored-by: brian m. carlson --- commands/command_migrate.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/commands/command_migrate.go b/commands/command_migrate.go index 9bf9645f..55d5dc4d 100644 --- a/commands/command_migrate.go +++ b/commands/command_migrate.go @@ -221,9 +221,10 @@ func includeExcludeRefs(l *tasklog.Logger, args []string) (include, exclude []st return nil, nil, err } - for _, refs := range remoteRefs { + for remote, refs := range remoteRefs { for _, ref := range refs { - exclude = append(exclude, ref.Refspec()) + exclude = append(exclude, + formatRefName(ref, remote)) } } } @@ -263,13 +264,6 @@ func getRemoteRefs(l *tasklog.Logger) (map[string][]*git.Ref, error) { return nil, err } - for i, rr := range refsForRemote { - // HACK(@ttaylorr): add remote name to fully-qualify - // references: - refsForRemote[i].Name = - fmt.Sprintf("%s/%s", remote, rr.Name) - } - refs[remote] = refsForRemote }