better messages for bare repositories
This commit is contained in:
parent
3e61749d08
commit
c1166aaad7
1 changed files with 16 additions and 10 deletions
|
@ -13,6 +13,7 @@ import System.Log.Handler.Simple
|
||||||
import qualified Data.Set as S
|
import qualified Data.Set as S
|
||||||
|
|
||||||
import Common
|
import Common
|
||||||
|
import qualified Git
|
||||||
import qualified Git.CurrentRepo
|
import qualified Git.CurrentRepo
|
||||||
import qualified Git.RecoverRepository
|
import qualified Git.RecoverRepository
|
||||||
import qualified Git.Config
|
import qualified Git.Config
|
||||||
|
@ -75,6 +76,7 @@ main = do
|
||||||
deindexedfiles <- Git.RecoverRepository.rewriteIndex stillmissing g
|
deindexedfiles <- Git.RecoverRepository.rewriteIndex stillmissing g
|
||||||
printList deindexedfiles
|
printList deindexedfiles
|
||||||
"Removed these missing files from the index. You should look at what files are present in your working tree and git add them back to the index when appropriate."
|
"Removed these missing files from the index. You should look at what files are present in your working tree and git add them back to the index when appropriate."
|
||||||
|
unless (Git.repoIsLocalBare g) $ do
|
||||||
mcurr <- Git.Branch.currentUnsafe g
|
mcurr <- Git.Branch.currentUnsafe g
|
||||||
case mcurr of
|
case mcurr of
|
||||||
Nothing -> return ()
|
Nothing -> return ()
|
||||||
|
@ -84,6 +86,10 @@ main = do
|
||||||
, show curr
|
, show curr
|
||||||
, "checked out. You may have staged changes in the index that can be committed to recover the lost state of this branch!"
|
, "checked out. You may have staged changes in the index that can be committed to recover the lost state of this branch!"
|
||||||
]
|
]
|
||||||
|
else if Git.repoIsLocalBare g
|
||||||
|
then do
|
||||||
|
putStrLn "If you have a clone of this bare repository, you should add it as a remote of this repository, and re-run git-recover-repository."
|
||||||
|
putStrLn "If there are no clones of this repository, you can instead run git-recover-repository with the --force parameter to force recovery to a possibly usable state."
|
||||||
else putStrLn "To force a recovery to a usable state, run this command again with the --force parameter."
|
else putStrLn "To force a recovery to a usable state, run this command again with the --force parameter."
|
||||||
|
|
||||||
printList :: [String] -> String -> IO ()
|
printList :: [String] -> String -> IO ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue