aboutsummaryrefslogtreecommitdiffstats
path: root/worktree_commit.go
diff options
context:
space:
mode:
authorjsteuer <jan.niklas.steuer@gmail.com>2021-02-09 11:33:11 +0100
committerGitHub <noreply@github.com>2021-02-09 11:33:11 +0100
commitc66023ad305ee56a38781cc5d3ca96c7115bd2e5 (patch)
treea0ad6f570ced1f59ab15e7273c3cf0c3d4f7ffa4 /worktree_commit.go
parent024d62b96ac19b40473f04931f9c12c8e24e0f7a (diff)
downloadgo-git-c66023ad305ee56a38781cc5d3ca96c7115bd2e5.tar.gz
git: worktree_commit, just store objects not already stored (#224)
* git: worktree_commit, just store objects not already stored
Diffstat (limited to 'worktree_commit.go')
-rw-r--r--worktree_commit.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/worktree_commit.go b/worktree_commit.go
index a9d0e04..a5779fc 100644
--- a/worktree_commit.go
+++ b/worktree_commit.go
@@ -230,5 +230,9 @@ func (h *buildTreeHelper) copyTreeToStorageRecursive(parent string, t *object.Tr
return plumbing.ZeroHash, err
}
+ hash := o.Hash()
+ if h.s.HasEncodedObject(hash) == nil {
+ return hash, nil
+ }
return h.s.SetEncodedObject(o)
}