darcs

Issue 2249 findRepository has a bogus-looking case when given a file, not directory

Title findRepository has a bogus-looking case when given a file, not directory
Priority Status resolved
Milestone Resolved in 2.10.0
Superseder Nosy List jaredj, owst
Assigned To
Topics ProbablyEasy

Created on 2012-10-01.01:04:44 by owst, last changed 2014-10-19.20:27:42 by noreply.

Messages
msg16193 (view) Author: owst Date: 2012-10-01.01:04:42
src/Darcs/Repository/Internal.hs line~397:

    findRepository :: WorkRepo -> IO (Either String ())
    findRepository (WorkRepoURL d) | isFile d =
        do setCurrentDirectory d `catchall` fail ("can't set directory
to "++d)
           findRepository WorkRepoCurrentDir
    findRepository (WorkRepoDir d) =
        do setCurrentDirectory d `catchall` fail ("can't set directory
to "++d)
           findRepository WorkRepoCurrentDir
    findRepository _ = maybe (Right ()) id <$> seekRepo

that first case (with the guard) looks stupid - C&P? It should
presumably just fail, since a repo can't be "in" a file...

I'm in the middle of a de-lint session, so recording this for later
msg17699 (view) Author: noreply Date: 2014-10-19.20:27:40
The following patch sent by mle@mlen.pl updated issue issue2249 with
status=resolved;resolvedin=2.10.0 HEAD

* Resolve issue2249: Rename isFile to isValidLocalPath and WorkRepoURL to WorkRepoPossibleURL 
Ignore-this: 7273172e1131a0a6870f1d203d241b97
History
Date User Action Args
2012-10-01 01:04:44owstcreate
2014-10-19 20:27:42noreplysetstatus: unknown -> resolved
messages: + msg17699
resolvedin: 2.10.0