aboutsummaryrefslogtreecommitdiff
path: root/Remotes.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-31 23:38:07 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-31 23:38:07 -0400
commitcec25153ecd4f824cf150afbd294ad0c5ed1413e (patch)
treee9326121cd6be570c48fb7d09b047e52599ba1c3 /Remotes.hs
parent00d4c7cd01b6f6e863a22483b9ea20ca5260da43 (diff)
bugfix: git annex move --from <file remote>
The data structure comparison didn't work because for a file remote, the config gets read for one structure but not the other.
Diffstat (limited to 'Remotes.hs')
-rw-r--r--Remotes.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Remotes.hs b/Remotes.hs
index 2879516fe..dffbe8f50 100644
--- a/Remotes.hs
+++ b/Remotes.hs
@@ -10,6 +10,7 @@ module Remotes (
keyPossibilities,
tryGitConfigRead,
inAnnex,
+ same,
commandLineRemote,
copyFromRemote,
copyToRemote,
@@ -47,7 +48,7 @@ keyPossibilities key = do
uuids <- liftIO $ keyLocations g key
allremotes <- remotesByCost
-- To determine if a remote has a key, its UUID needs to be known.
- -- The locally cached UIIDs of remotes can fall out of date if
+ -- The locally cached UUIDs of remotes can fall out of date if
-- eg, a different drive is mounted at the same location.
-- But, reading the config of remotes can be expensive, so make
-- sure we only do it once per git-annex run.
@@ -147,6 +148,10 @@ repoNotIgnored r = do
match name = name == Git.repoRemoteName r
isIgnored ignored = Git.configTrue ignored
+{- Checks if two repos are the same, by comparing their remote names. -}
+same :: Git.Repo -> Git.Repo -> Bool
+same a b = Git.repoRemoteName a == Git.repoRemoteName b
+
{- Returns the remote specified by --from or --to, may fail with error. -}
commandLineRemote :: Annex Git.Repo
commandLineRemote = do