optimisation
avoids a useless diff from git-annex..refs/heads/git-annex
This commit is contained in:
parent
c7e65bbb12
commit
f9cd3f6ad1
1 changed files with 4 additions and 2 deletions
|
@ -213,7 +213,7 @@ update = onceonly $ do
|
||||||
create
|
create
|
||||||
-- check what needs updating before taking the lock
|
-- check what needs updating before taking the lock
|
||||||
dirty <- journalDirty
|
dirty <- journalDirty
|
||||||
c <- filterM (changedBranch name . snd) =<< siblingBranches
|
c <- filterM (changedBranch fullname . snd) =<< siblingBranches
|
||||||
let (refs, branches) = unzip c
|
let (refs, branches) = unzip c
|
||||||
if (not dirty && null refs)
|
if (not dirty && null refs)
|
||||||
then simpleupdate
|
then simpleupdate
|
||||||
|
@ -244,7 +244,9 @@ update = onceonly $ do
|
||||||
{- Checks if the second branch has any commits not present on the first
|
{- Checks if the second branch has any commits not present on the first
|
||||||
- branch. -}
|
- branch. -}
|
||||||
changedBranch :: Git.Branch -> Git.Branch -> Annex Bool
|
changedBranch :: Git.Branch -> Git.Branch -> Annex Bool
|
||||||
changedBranch origbranch newbranch = not . L.null <$> diffs
|
changedBranch origbranch newbranch
|
||||||
|
| origbranch == newbranch = return False
|
||||||
|
| otherwise = not . L.null <$> diffs
|
||||||
where
|
where
|
||||||
diffs = inRepo $ Git.pipeRead
|
diffs = inRepo $ Git.pipeRead
|
||||||
[ Param "log"
|
[ Param "log"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue