Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [egit-dev] I'm programmatically pushing but tracking branch doesnt get updated?

> Hi
> 
> I'm having an issue where I push (a local clone which I committed to)
> to
> a remote and once I've done this I dont see the decorators (<arrow
> up>1)
> go away. They only disappear if I do an additional fetch (and cause
> the
> tracking branch to get updated?).
> EGit/PushWizard is working fine, no issue, it's just in my code where
> I
> create a PushOperation programmatically. I do something like this:
> 
> <snip>
>          Collection<URIish> pushURIs = getPushURIs(remoteConfig);
>          Collection<RefSpec> pushRefSpecs =
>          createForceRefSpecs(force,
> getPushRefSpecs(remoteConfig));
>          PushOperationSpecification pushSpec =
>          createPushSpec(pushURIs,
> pushRefSpecs, repository);
>          PushOperation pushOperation = new PushOperation(repository,
> pushSpec, false, DEFAULT_TIMEOUT);
>          pushOperation.setOutputStream(out);
>          pushOperation.run(monitor);
> </snip>
> 
> I was wondering what I was missing. I checked for differences with
> PushWizard but couldn't spot any. I'd love if you could give me some
> pointer to the code that causes the remote tracking branch to get
> updated after the push.

I think the problem is that you are pushing directly to an URI (not a
named remote) and are not passing the fetch refspecs when calculating
RemoteRefUpdates for PushOperationSpecification.

createPushSpec is not included in the above code, so it's just a guess.

Look at what PushOperationUI does here:

https://git.eclipse.org/c/egit/egit.git/tree/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushOperationUI.java?id=1b6194a214bb518b47c4d8488353e36f4bcf2990#n178

Regards,
  Nibor


Back to the top