can't checkout adjusted branch while index is still locked
There's a race here, but entering an adjusted branch for the first time is not something to do when a commit is being made at the same time. Although, may want to prevent the assistant from committing while entering the adjusted branch.
This commit is contained in:
parent
6024108ab2
commit
91f37673df
2 changed files with 11 additions and 2 deletions
|
@ -91,8 +91,8 @@ originalBranch = fmap fromAdjustedBranch <$> inRepo Git.Branch.current
|
||||||
enterAdjustedBranch :: Adjustment -> Annex ()
|
enterAdjustedBranch :: Adjustment -> Annex ()
|
||||||
enterAdjustedBranch adj = go =<< originalBranch
|
enterAdjustedBranch adj = go =<< originalBranch
|
||||||
where
|
where
|
||||||
go (Just origbranch) = preventCommits $ do
|
go (Just origbranch) = do
|
||||||
adjbranch <- adjustBranch adj origbranch
|
adjbranch <- preventCommits $ adjustBranch adj origbranch
|
||||||
inRepo $ Git.Command.run
|
inRepo $ Git.Command.run
|
||||||
[ Param "checkout"
|
[ Param "checkout"
|
||||||
, Param $ fromRef $ Git.Ref.base $ adjbranch
|
, Param $ fromRef $ Git.Ref.base $ adjbranch
|
||||||
|
|
|
@ -342,3 +342,12 @@ like this, at its most simple:
|
||||||
-- Generate a version of the commit made on the filter branch
|
-- Generate a version of the commit made on the filter branch
|
||||||
-- with the filtering of modified files reversed.
|
-- with the filtering of modified files reversed.
|
||||||
unfilteredCommit :: Filter -> Git.Commit -> Git.Commit
|
unfilteredCommit :: Filter -> Git.Commit -> Git.Commit
|
||||||
|
|
||||||
|
## TODOs
|
||||||
|
|
||||||
|
* Need a better command-line interface than `git annex adjust`,
|
||||||
|
that allows picking adjustments.
|
||||||
|
* Interface in webapp to enable adjustments.
|
||||||
|
* Entering an adjusted branch can race with commits to the current branch,
|
||||||
|
and so the assistant should not be running, or at least should have
|
||||||
|
commits disabled when entering it.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue