From: Jonas Fonseca <fonseca@diku.dk>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: Jonas Fonseca <jonas.fonseca@gmail.com>,
Robin Rosenberg <robin.rosenberg@dewire.com>,
git@vger.kernel.org
Subject: [JGIT PATCH] Fix ObjectLoader.getBytes to really return the created copy
Date: Fri, 10 Oct 2008 00:09:36 +0200 [thread overview]
Message-ID: <20081009220932.GA30350@diku.dk> (raw)
In-Reply-To: <20081009214926.GA8203@spearce.org>
The bug was carried over from the original code in PackedObjectLoader by
commit 4c49ab5a4ec8555681ceabf17142a15bf90c2c24.
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
.../src/org/spearce/jgit/lib/ObjectLoader.java | 2 +-
Shawn O. Pearce <spearce@spearce.org> wrote Thu, Oct 09, 2008:
> I think its already committed to master too. Can you send a patch
> along to fix, and point out how stupid I am?
Yes, I noticed it has already been applied. I am lagging behind a bit.
Anyway, here is a trivial patch.
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectLoader.java b/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectLoader.java
index 87e861f..8d745dd 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectLoader.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectLoader.java
@@ -109,7 +109,7 @@ protected void setId(final ObjectId id) {
final byte[] data = getCachedBytes();
final byte[] copy = new byte[data.length];
System.arraycopy(data, 0, copy, 0, data.length);
- return data;
+ return copy;
}
/**
--
1.6.0.2.665.g48ddf
--
Jonas Fonseca
prev parent reply other threads:[~2008-10-09 22:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-01 1:31 [JGIT PATCH 0/5] Support receive.fsckobjects Shawn O. Pearce
2008-10-01 1:31 ` [JGIT PATCH 1/5] Expose RawParseUtils.match to application callers Shawn O. Pearce
2008-10-01 1:31 ` [JGIT PATCH 2/5] Fix UnpackedObjectLoader.getBytes to return a copy Shawn O. Pearce
2008-10-01 1:31 ` [JGIT PATCH 3/5] Object validation tests for "jgit fsck" Shawn O. Pearce
2008-10-01 1:31 ` [JGIT PATCH 4/5] Expose the critical receive configuration options to JGit Shawn O. Pearce
2008-10-01 1:31 ` [JGIT PATCH 5/5] Honor receive.fsckobjects during any fetch connection Shawn O. Pearce
2008-10-01 20:54 ` [JGIT PATCH 4/5] Expose the critical receive configuration options to JGit Robin Rosenberg
2008-10-02 22:46 ` Shawn O. Pearce
2008-10-09 21:46 ` [JGIT PATCH 2/5] Fix UnpackedObjectLoader.getBytes to return a copy Jonas Fonseca
2008-10-09 21:49 ` Shawn O. Pearce
2008-10-09 22:09 ` Jonas Fonseca [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081009220932.GA30350@diku.dk \
--to=fonseca@diku.dk \
--cc=git@vger.kernel.org \
--cc=jonas.fonseca@gmail.com \
--cc=robin.rosenberg@dewire.com \
--cc=spearce@spearce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).