aboutsummaryrefslogtreecommitdiffstats
path: root/worktree_commit.go
diff options
context:
space:
mode:
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)
}