git annex add in adjusted unlocked branch
Cached the current branch lookup just because it seems unnecessary overhead to run an extra git command per add to query the current branch.
This commit is contained in:
parent
4226ae1040
commit
42b7ccc89f
4 changed files with 29 additions and 5 deletions
|
@ -12,6 +12,7 @@ module Annex.AdjustedBranch (
|
|||
originalToAdjusted,
|
||||
adjustedToOriginal,
|
||||
fromAdjustedBranch,
|
||||
getAdjustment,
|
||||
enterAdjustedBranch,
|
||||
updateAdjustedBranch,
|
||||
propigateAdjustedCommits,
|
||||
|
@ -45,7 +46,7 @@ data Adjustment
|
|||
| LockAdjustment
|
||||
| HideMissingAdjustment
|
||||
| ShowMissingAdjustment
|
||||
deriving (Show)
|
||||
deriving (Show, Eq)
|
||||
|
||||
reverseAdjustment :: Adjustment -> Adjustment
|
||||
reverseAdjustment UnlockAdjustment = LockAdjustment
|
||||
|
@ -122,6 +123,9 @@ adjustedToOriginal b
|
|||
bs = fromRef b
|
||||
prefixlen = length adjustedBranchPrefix
|
||||
|
||||
getAdjustment :: Branch -> Maybe Adjustment
|
||||
getAdjustment = fmap fst . adjustedToOriginal
|
||||
|
||||
fromAdjustedBranch :: Branch -> OrigBranch
|
||||
fromAdjustedBranch b = maybe b snd (adjustedToOriginal b)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue