[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jgit-dev] InternalJGitException when there's nothing to push
|
On Mon, Feb 14, 2011 at 04:34, Thomas Hallgren <thomas@xxxxxxx> wrote:
> I sometimes use JGit to push from a repository that has already been pushed.
> When I do that, the PushCommand.call() triggers an exception from the
> Transport that tells me that there's nothing to push. And sure, that's
> correct. My question is, is this really an error? The push command then
> wraps this in an JGitInternalException so I need to dig fairly deep just to
> conclude that my push was a no-op. Perhaps this could be indicated by
> returning an empty PushResult list?
Yes, I agree. If there is nothing to push because the remote matches
the request we were given, we should return a PushResult that shows
the references were not modified. Unfortunately that is awkward to
troll through to see if everything is already up-to-date, but its most
likely the best way to represent that state, because its what happens
when you push 2 references and 1 is up-to-date and another actually
transfers.
So whoever is throwing the exception is wrong.
--
Shawn.