make path absolute for display
Avoid suggesting the user add "." to safe.directory.
This commit is contained in:
parent
d7e338f221
commit
f35c551d35
1 changed files with 8 additions and 7 deletions
|
@ -229,19 +229,20 @@ objectDirNotPresent = do
|
||||||
return (not exists)
|
return (not exists)
|
||||||
|
|
||||||
guardSafeToUseRepo :: Annex a -> Annex a
|
guardSafeToUseRepo :: Annex a -> Annex a
|
||||||
guardSafeToUseRepo a = do
|
guardSafeToUseRepo a = ifM (inRepo Git.Config.checkRepoConfigInaccessible)
|
||||||
repopath <- fromRepo Git.repoPath
|
( do
|
||||||
ifM (inRepo Git.Config.checkRepoConfigInaccessible)
|
repopath <- fromRepo Git.repoPath
|
||||||
( giveup $ unlines $
|
p <- liftIO $ absPath repopath
|
||||||
|
giveup $ unlines $
|
||||||
[ "Git refuses to operate in this repository,"
|
[ "Git refuses to operate in this repository,"
|
||||||
, "probably because it is owned by someone else."
|
, "probably because it is owned by someone else."
|
||||||
, ""
|
, ""
|
||||||
-- This mirrors git's wording.
|
-- This mirrors git's wording.
|
||||||
, "To add an exception for this directory, call:"
|
, "To add an exception for this directory, call:"
|
||||||
, "\tgit config --global --add safe.directory " ++ fromRawFilePath repopath
|
, "\tgit config --global --add safe.directory " ++ fromRawFilePath p
|
||||||
]
|
]
|
||||||
, a
|
, a
|
||||||
)
|
)
|
||||||
|
|
||||||
{- Initialize if it can do so automatically. Avoids failing if it cannot.
|
{- Initialize if it can do so automatically. Avoids failing if it cannot.
|
||||||
-
|
-
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue