Stores the binary content of a tracked file.
Inheritance: GitObject
示例#1
0
 internal ContentChanges(Repository repo, Blob oldBlob, Blob newBlob, GitDiffOptions options)
 {
     Proxy.git_diff_blobs(repo.Handle,
                          oldBlob != null ? oldBlob.Id : null,
                          newBlob != null ? newBlob.Id : null,
                          options, FileCallback, HunkCallback, LineCallback);
 }
示例#2
0
 /// <summary>
 ///   Show changes between two <see cref = "Blob"/>s.
 /// </summary>
 /// <param name = "oldBlob">The <see cref = "Blob"/> you want to compare from.</param>
 /// <param name = "newBlob">The <see cref = "Blob"/> you want to compare to.</param>
 /// <returns>A <see cref = "ContentChanges"/> containing the changes between the <paramref name = "oldBlob"/> and the <paramref name = "newBlob"/>.</returns>
 public virtual ContentChanges Compare(Blob oldBlob, Blob newBlob)
 {
     using (GitDiffOptions options = BuildOptions(DiffOptions.None))
     {
         return new ContentChanges(repo, oldBlob, newBlob, options);
     }
 }
示例#3
0
 internal ContentChanges(Repository repo, Blob oldBlob, Blob newBlob, GitDiffOptions options)
 {
     using (var osw1 = new ObjectSafeWrapper(oldBlob.Id, repo))
     using (var osw2 = new ObjectSafeWrapper(newBlob.Id, repo))
     {
         Ensure.Success(NativeMethods.git_diff_blobs(osw1.ObjectPtr, osw2.ObjectPtr, options, IntPtr.Zero, FileCallback, HunkCallback, LineCallback));
     }
 }
示例#4
0
        private async Task ImportBuildManifestAsync(ProdConTrackerDbContext db, LibGit2Sharp.Blob blob, string branch, Commit commit, HashSet <string> loadedBuilds)
        {
            var orchBuild = BuildXmlLoader.Load(blob.GetContentText(), branch);

            // Check if the build already exists
            if (!loadedBuilds.Contains(orchBuild.OrchestratedBuildId) && !await db.OrchestratedBuilds.AnyAsync(b => b.OrchestratedBuildId == orchBuild.OrchestratedBuildId))
            {
                _logger.LogInformation("Importing build {BuildId} ...", orchBuild.OrchestratedBuildId);

                db.OrchestratedBuilds.Add(orchBuild);
                foreach (var build in orchBuild.Builds)
                {
                    db.Builds.Add(build);
                }

                _logger.LogInformation("Saving to database...");
                await db.SaveChangesAsync();
            }
        }
示例#5
0
 private void AddBlob(Blob blob)
 {
     var blobVertex = new BlobVertex(blob);
     _contents.AddVertex(blobVertex);
 }
示例#6
0
文件: BlobVertex.cs 项目: g0t4/SeeGit
 public BlobVertex(Blob blob)
     : base(blob)
 {
 }
示例#7
0
 /// <summary>
 /// Show changes between two <see cref="Blob"/>s.
 /// </summary>
 /// <param name="oldBlob">The <see cref="Blob"/> you want to compare from.</param>
 /// <param name="newBlob">The <see cref="Blob"/> you want to compare to.</param>
 /// <param name="compareOptions">Additional options to define comparison behavior.</param>
 /// <returns>A <see cref="ContentChanges"/> containing the changes between the <paramref name="oldBlob"/> and the <paramref name="newBlob"/>.</returns>
 public virtual ContentChanges Compare(Blob oldBlob, Blob newBlob, CompareOptions compareOptions = null)
 {
     using (GitDiffOptions options = BuildOptions(DiffModifiers.None, compareOptions: compareOptions))
     {
         return new ContentChanges(repo, oldBlob, newBlob, options);
     }
 }
示例#8
0
 /// <summary>
 ///   Show changes between two <see cref = "Blob"/>s.
 /// </summary>
 /// <param name = "oldBlob">The <see cref = "Blob"/> you want to compare from.</param>
 /// <param name = "newBlob">The <see cref = "Blob"/> you want to compare to.</param>
 /// <returns>A <see cref = "ContentChanges"/> containing the changes between the <paramref name = "oldBlob"/> and the <paramref name = "newBlob"/>.</returns>
 public ContentChanges Compare(Blob oldBlob, Blob newBlob)
 {
     return new ContentChanges(repo, oldBlob, newBlob, DefaultOptions);
 }
示例#9
0
 /// <summary>
 /// Show changes between two <see cref="Blob"/>s.
 /// </summary>
 /// <param name="oldBlob">The <see cref="Blob"/> you want to compare from.</param>
 /// <param name="newBlob">The <see cref="Blob"/> you want to compare to.</param>
 /// <returns>A <see cref="ContentChanges"/> containing the changes between the <paramref name="oldBlob"/> and the <paramref name="newBlob"/>.</returns>
 public virtual ContentChanges Compare(Blob oldBlob, Blob newBlob)
 {
     return(Compare(oldBlob, newBlob, null));
 }
示例#10
0
 internal static TreeEntryDefinition From(Blob blob, Mode mode)
 {
     return new TreeEntryDefinition
                {
                    Mode = mode,
                    Type = GitObjectType.Blob,
                    TargetId = blob.Id,
                    target = new Lazy<GitObject>(() => blob)
                };
 }