diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2017-08-04 12:55:27 +0300 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2017-08-04 12:55:27 +0300 |
commit | 7c69f1ff3bf7d384a6645eb1c321818b8a3ed6b2 (patch) | |
tree | 7a4eb089ecffb94c575078ecad6415cd30793406 | |
parent | 5f0270986d3f89040db085b05ef25e9b8f8c4c9f (diff) |
Prefer long options for clarity
-rw-r--r-- | internal/helper/repo.go | 2 | ||||
-rw-r--r-- | internal/service/commit/last_commit_for_path.go | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/internal/helper/repo.go b/internal/helper/repo.go index 53f363257..33b51d924 100644 --- a/internal/helper/repo.go +++ b/internal/helper/repo.go @@ -87,7 +87,7 @@ func IsValidRef(ctx context.Context, path, ref string) bool { return false } - cmd, err := GitCommandReader(ctx, "--git-dir", path, "log", "-1", ref) + cmd, err := GitCommandReader(ctx, "--git-dir", path, "log", "--max-count=1", ref) if err != nil { return false } diff --git a/internal/service/commit/last_commit_for_path.go b/internal/service/commit/last_commit_for_path.go index 0235b1c17..e89f6d3d3 100644 --- a/internal/service/commit/last_commit_for_path.go +++ b/internal/service/commit/last_commit_for_path.go @@ -27,7 +27,8 @@ func (s *server) LastCommitForPath(ctx context.Context, in *pb.LastCommitForPath path = "." } - if err := gitLog(ctx, writer, in.GetRepository(), []string{string(in.GetRevision())}, []string{path}, "-1"); err != nil { + revisions := []string{string(in.GetRevision())} + if err := gitLog(ctx, writer, in.GetRepository(), revisions, []string{path}, "--max-count=1"); err != nil { return nil, err } |