You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log.Fatalf("An error ocurred while phusing data to remote %s.Status code %d. Reply: %s", codeperfApiUrl, resp.StatusCode, string(reply))
134
+
log.Fatalf("An error ocurred while pushing cpu data to remote %s.\nEndpoint %s. Status code %d. Reply: %s", codeperfApiUrl, endPoint, resp.StatusCode, string(reply))
log.Fatalf("An error ocurred while pushing cpu data to remote %s.\nEndpoint %s. Status code %d. Reply: %s", codeperfApiUrl, endPoint, resp.StatusCode, string(reply))
137
+
}
138
+
54
139
}
55
140
56
141
// Execute adds all child commands to the root command and sets flags appropriately.
57
142
// This is called by main.main(). It only needs to happen once to the rootCmd.
58
143
funcExecute() {
144
+
rootCmd.AddCommand(cmdPrint)
59
145
cobra.CheckErr(rootCmd.Execute())
60
146
}
61
147
@@ -64,12 +150,16 @@ func init() {
64
150
defaultGitOrg:=""
65
151
defaultGitRepo:=""
66
152
defaultGitCommit:=""
153
+
defaultGitBranch:=""
67
154
68
155
r, err:=git.PlainOpen(".")
69
156
iferr!=nil {
70
-
log.Println("Unable to retrieve current repo git info. Use the --git-org, --git-repo, and --git-hash to properly fill the git info.")
157
+
log.Println("Unable to retrieve current repo git info. Use the --git-org, --git-repo, --git-branch and --git-hash to properly fill the git info.")
71
158
} else {
72
159
ref, _:=r.Head()
160
+
ifref.Name().IsBranch() {
161
+
defaultGitBranch=ref.Name().Short()
162
+
}
73
163
refHash:=ref.Hash().String()
74
164
defaultGitCommit=getShortHash(refHash, 7)
75
165
remotes, _:=r.Remotes()
@@ -87,14 +177,15 @@ func init() {
87
177
88
178
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.codeperf.yaml)")
89
179
rootCmd.PersistentFlags().BoolVar(&local, "local", false, "don't push the data to https://codeperf.io")
rootCmd.PersistentFlags().StringVar(&localFilename, "local-filename", "profile.json", "Local file to export the json to. Only used when the --local flag is set")
0 commit comments