Ver código fonte

fix(cmd): read log-opts before GitLogCmd (#1730)

Richard Gomez 1 ano atrás
pai
commit
1f323d8b69
1 arquivos alterados com 1 adições e 2 exclusões
  1. 1 2
      cmd/detect.go

+ 1 - 2
cmd/detect.go

@@ -96,10 +96,10 @@ func runDetect(cmd *cobra.Command, args []string) {
 		}
 	} else {
 		var (
+			logOpts     = mustGetStringFlag(cmd, "log-opts")
 			gitCmd      *sources.GitCmd
 			scmPlatform scm.Platform
 			remote      *detect.RemoteInfo
-			logOpts     string
 		)
 		if gitCmd, err = sources.NewGitLogCmd(source, logOpts); err != nil {
 			logging.Fatal().Err(err).Msg("could not create Git cmd")
@@ -110,7 +110,6 @@ func runDetect(cmd *cobra.Command, args []string) {
 		if remote, err = detect.NewRemoteInfo(scmPlatform, source); err != nil {
 			logging.Fatal().Err(err).Msg("failed to scan Git repository")
 		}
-		logOpts = mustGetStringFlag(cmd, "log-opts")
 
 		if findings, err = detector.DetectGit(gitCmd, remote); err != nil {
 			// don't exit on error, just log it