Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JGit Push messages

Tags:

jgit

Am trying to push using JGit. However my PushResults never has the messages assosiated with Push. For example how do I get the message "Everything-up-to-date" when my push has nohing new. Basically I want to get the result messages from JGit. Any help would be greatly appreciated.

I kind of figured from the code that those messages are written by Push.java under the option that Verbose is set to true. But I couldn't find a way to set verbose on.

like image 317
user3908386 Avatar asked Jun 11 '26 06:06

user3908386


1 Answers

PushResult#getMessages() returns additional messages sent from the remote. Gerrit for example would send a message that explains why a push was rejected.

In order to obtain the result of a push operation you can call PushResult#getRemoteUpdates(). It returns a RemoteRefUpdate that holds the status for each ref that was to be updated.

Does that answer your question?

like image 148
Rüdiger Herrmann Avatar answered Jun 19 '26 19:06

Rüdiger Herrmann



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!