(args *Args)
| 39 | } |
| 40 | |
| 41 | func transformPushArgs(args *Args) { |
| 42 | refs := []string{} |
| 43 | if args.ParamsSize() > 1 { |
| 44 | refs = args.Params[1:] |
| 45 | } |
| 46 | |
| 47 | remotes := strings.Split(args.FirstParam(), ",") |
| 48 | args.ReplaceParam(0, remotes[0]) |
| 49 | |
| 50 | if len(refs) == 0 { |
| 51 | localRepo, err := github.LocalRepo() |
| 52 | utils.Check(err) |
| 53 | |
| 54 | head, err := localRepo.CurrentBranch() |
| 55 | utils.Check(err) |
| 56 | |
| 57 | refs = []string{head.ShortName()} |
| 58 | args.AppendParams(refs...) |
| 59 | } |
| 60 | |
| 61 | for _, remote := range remotes[1:] { |
| 62 | afterCmd := []string{"git", "push", remote} |
| 63 | afterCmd = append(afterCmd, refs...) |
| 64 | args.After(afterCmd...) |
| 65 | } |
| 66 | } |
searching dependent graphs…