|
This adds a LocalRefManager, which handles ref updates to local
repositories (i.e. your workspace).
It provides proxy methods for ref updates to a set of repositories.
If an exception occurs in the body of the context manager, the updates
will be rolled back to before the context manager was entered.
The purpose for using a LocalRefManager instead of making the changes to
the repositories directly, is to provide atomic updates to a set of refs
in a set of repositories, where all refs are updated, or none are.
This also adds a RemoteRefManager, which handles pushing branches to
remote repositories.
It provides a proxy push method, which will delete pushed branches, and
re-push deleted branches after the context manager exits.
Its purpose, instead of providing atomic updates to remote repositories,
is to provide temporary branches. This is because it is used to provide
temporary build branches. The difference between atomic update and
temporary push, is that the remote branches are deleted when the context
is left, rather than kept, as LocalRefManager does.
The RemoteRefManager currently cannot provide the same atomicity
guarantees as the LocalRefManager, so if there is a push between the
branch being created and the RemoteRefManager cleaning it up, that change
is lost without RemoteRefManager even knowing it existed.
Git 1.8.5 will add functionality to make this possible.
|