summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-12-12 02:31:07 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-12-12 02:31:07 -0400
commitf9cd3f6ad18ca04a1da7082c6c10215dc5435154 (patch)
treebe3e10b1bf7ece209e4206ef7d0bf82d1a68f331
parentc7e65bbb12db3db314d809e0186db0905c677d2f (diff)
optimisation
avoids a useless diff from git-annex..refs/heads/git-annex
-rw-r--r--Annex/Branch.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Annex/Branch.hs b/Annex/Branch.hs
index b108281ce..e6c92fbe5 100644
--- a/Annex/Branch.hs
+++ b/Annex/Branch.hs
@@ -213,7 +213,7 @@ update = onceonly $ do
create
-- check what needs updating before taking the lock
dirty <- journalDirty
- c <- filterM (changedBranch name . snd) =<< siblingBranches
+ c <- filterM (changedBranch fullname . snd) =<< siblingBranches
let (refs, branches) = unzip c
if (not dirty && null refs)
then simpleupdate
@@ -244,7 +244,9 @@ update = onceonly $ do
{- Checks if the second branch has any commits not present on the first
- branch. -}
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
diffs = inRepo $ Git.pipeRead
[ Param "log"