Stores the binary content of a tracked file.
상속: 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
파일: Diff.cs 프로젝트: JenekX/libgit2sharp
 /// <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
파일: Diff.cs 프로젝트: kidaak/libgit2sharp
 /// <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)
                };
 }