Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2017-08-04 12:55:27 +0300
committerJacob Vosmaer <jacob@gitlab.com>2017-08-04 12:55:27 +0300
commit7c69f1ff3bf7d384a6645eb1c321818b8a3ed6b2 (patch)
tree7a4eb089ecffb94c575078ecad6415cd30793406
parent5f0270986d3f89040db085b05ef25e9b8f8c4c9f (diff)
Prefer long options for clarity
-rw-r--r--internal/helper/repo.go2
-rw-r--r--internal/service/commit/last_commit_for_path.go3
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
}