Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] conflicts between branches

Hi Tomo,


Some of the merge strategies have a secondary constructor argument inCore that seems like it can be used to run the merge in memory only which is what is needed for the bare repository case.



       * Create a new merge instance.


       * @param db

       *            repository database the merger will read from, and eventually

       *            write results back to.

       * @param inCore

       *            the merge will happen in memory, working folder will not be

       *            modified, in case of a non-trivial merge that requires manual

       *            resolution, the merger will fail.

       * @return the new merge instance which implements this strategy.


       public abstract Merger newMerger(Repository db, boolean inCore);



In ResolveMerger:



       * Set to true if this merge should work in-memory. The repos dircache and

       * workingtree are not touched by this method. Eventually needed files are

       * created as temporary files and a new empty, in-memory dircache will be

       * used instead the repo's one. Often used for bare repos where the repo

       * doesn't even have a workingtree and dircache.

       * @since 3.0


       protected boolean inCore;


As a starting point I would copy the MergeCommand class and then change line 327 (in jgit version to use this constructor with the second argument set to true.


Hope this helps,




From: jgit-dev-bounces@xxxxxxxxxxx [mailto:jgit-dev-bounces@xxxxxxxxxxx] On Behalf Of Tomasz Prus
Sent: Thursday, October 09, 2014 9:24 AM
To: jgit-dev@xxxxxxxxxxx
Subject: [jgit-dev] conflicts between branches



is it possible to get info about potential conflicts between two branches on the bare repository (will be a conflict if I try merge branch A to branch B) ? 




Back to the top