diff options
author | Nail Samatov <sanail@yandex.ru> | 2022-01-21 19:30:51 +0300 |
---|---|---|
committer | Thomas Wolf <thomas.wolf@paranor.ch> | 2022-01-27 20:55:58 +0100 |
commit | ad098b3b85c58fffd65b7daee03363b1e71d456c (patch) | |
tree | 804de299cc42e8ecc0f9db904d8764d04d5dfecb /org.eclipse.jgit.lfs/src/org | |
parent | 27e554e465d043ed12914fd42554164c9333fc44 (diff) | |
download | jgit-ad098b3b85c58fffd65b7daee03363b1e71d456c.tar.gz jgit-ad098b3b85c58fffd65b7daee03363b1e71d456c.zip |
LFS: Fix error occurring during delete branch
Fix TransportException occurring when deleting
a branch and push that change to remote repository
if BuiltinLFS is used to work with repository.
When finding LFS pointers in RemoteRepUpdate,
LfsPrePushHook fails to open ObjectReader
with new object id equal to ObjectId.zeroId().
If update is a deleting update (new object id is zero id),
we can assume that this update doesn't contain LFS Pointer
and we can skip step with extracting LFS pointer for that
RemoteRefUpdate.
Bug: 578313
Change-Id: Ic4367978338b8234d39d9af0d9674490f79fc22d
Signed-off-by: Nail Samatov <sanail@yandex.ru>
Diffstat (limited to 'org.eclipse.jgit.lfs/src/org')
-rw-r--r-- | org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPrePushHook.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPrePushHook.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPrePushHook.java index d6ce855794..ebf46e080e 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPrePushHook.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPrePushHook.java @@ -113,6 +113,9 @@ public class LfsPrePushHook extends PrePushHook { try (ObjectWalk walk = new ObjectWalk(getRepository())) { for (RemoteRefUpdate up : refs) { + if (up.isDelete()) { + continue; + } walk.setRewriteParents(false); excludeRemoteRefs(walk); walk.markStart(walk.parseCommit(up.getNewObjectId())); |