How to exclude stashes when requesting links?

I am trying to execute a query for commits:

repo.Commits.QueryBy(new LibGit2Sharp.Filter { Since = repo.Refs }).Take(100) 

Otherwise, this is normal, but it also returns stashes. How can I exclude stashes? I know that when I look at the results, I can simply ignore them, I think, but then I would not have 100 of them as I wanted.

+2
source share
1 answer

Since and Until properties of type Filter fairly tolerant of what they can be evaluated with.

According to the documentation, they

It can be either a string containing the name of the check or reference canonical name, a Branch , Link , Commit , TagAnnotation , ObjectId or even a mixed collection of all of the above.

Basically, Since = repo.Refs means "I want to retell from each repository link when listing pointed ones in commits."

Similarly to git log --all it really will consider branches, tags, braids, notes, ...

If you want to reduce the volume of links, you will need to choose what Since will be evaluated against.

  • Since = repo.Branches.Where(b => !b.IsRemote)
  • Since = new object[] { repo.Branches["br2"], "refs/heads/master", new ObjectId("e90810b") }

For example, to view branches and tags only, use

Since = new object[]{ repo.Branches, repo.Tags }

+1
source

All Articles