|How to check status of local branch with respect to remote branch in a lightweight way? [message #1219939]
||Fri, 06 December 2013 18:43
| Jarek Odzga
Registered: December 2013
I am trying to implement a polling of remote branch to discover that my local branch need to be updated.
I am initializing git repo this way:
val cloneCmd = Git.cloneRepository()
and then I can manually update it:
I am planning to implement polling remote repo (lets say every 15s), but I don't want to call pull() that often, because pull() is blocking other parts of app that use local branch. I'd like to check (often) somehow that local branch is behind and only then call pull().
How can I do that?
BTW, I want to use this mechanism to serve HTTP "directly from git repo". Obviously I have to "lock" traffic for a time of pull(). It is ok for my use case if this happens occasionally, but doing this every 15s is not acceptable.
Any help would be appreciated.
Powered by FUDForum
. Page generated in 0.02009 seconds