clean up old code
withworktree is no longer doing anything useful so remove it
This commit is contained in:
parent
03dee56546
commit
0e21a3221e
1 changed files with 6 additions and 9 deletions
|
@ -234,8 +234,8 @@ resolveMerge' unstagedmap (Just us) them inoverlay u = do
|
||||||
dest' <- toRawFilePath <$> stagefile dest
|
dest' <- toRawFilePath <$> stagefile dest
|
||||||
stageSymlink dest' =<< hashSymlink l
|
stageSymlink dest' =<< hashSymlink l
|
||||||
|
|
||||||
replacewithsymlink dest link = withworktree dest $ \f ->
|
replacewithsymlink dest link = replaceWorkTreeFile dest $
|
||||||
replaceWorkTreeFile f $ makeGitLink link . toRawFilePath
|
makeGitLink link . toRawFilePath
|
||||||
|
|
||||||
makepointer key dest destmode = do
|
makepointer key dest destmode = do
|
||||||
unless inoverlay $
|
unless inoverlay $
|
||||||
|
@ -250,8 +250,6 @@ resolveMerge' unstagedmap (Just us) them inoverlay u = do
|
||||||
Database.Keys.addAssociatedFile key
|
Database.Keys.addAssociatedFile key
|
||||||
=<< inRepo (toTopFilePath (toRawFilePath dest))
|
=<< inRepo (toTopFilePath (toRawFilePath dest))
|
||||||
|
|
||||||
withworktree f a = a f
|
|
||||||
|
|
||||||
{- Stage a graft of a directory or file from a branch
|
{- Stage a graft of a directory or file from a branch
|
||||||
- and update the work tree. -}
|
- and update the work tree. -}
|
||||||
graftin b item selectwant selectwant' selectunwant = do
|
graftin b item selectwant selectwant' selectunwant = do
|
||||||
|
@ -272,7 +270,7 @@ resolveMerge' unstagedmap (Just us) them inoverlay u = do
|
||||||
-- And when grafting in anything else vs a symlink,
|
-- And when grafting in anything else vs a symlink,
|
||||||
-- the work tree already contains what we want.
|
-- the work tree already contains what we want.
|
||||||
(_, Just TreeSymlink) -> noop
|
(_, Just TreeSymlink) -> noop
|
||||||
_ -> ifM (withworktree item (liftIO . doesDirectoryExist))
|
_ -> ifM (liftIO $ doesDirectoryExist item)
|
||||||
-- a conflict between a file and a directory
|
-- a conflict between a file and a directory
|
||||||
-- leaves the directory, so since a directory
|
-- leaves the directory, so since a directory
|
||||||
-- is there, it must be what was wanted
|
-- is there, it must be what was wanted
|
||||||
|
@ -282,8 +280,7 @@ resolveMerge' unstagedmap (Just us) them inoverlay u = do
|
||||||
-- file content
|
-- file content
|
||||||
, case selectwant' (LsFiles.unmergedSha u) of
|
, case selectwant' (LsFiles.unmergedSha u) of
|
||||||
Nothing -> noop
|
Nothing -> noop
|
||||||
Just sha -> withworktree item $ \f ->
|
Just sha -> replaceWorkTreeFile item $ \tmp -> do
|
||||||
replaceWorkTreeFile f $ \tmp -> do
|
|
||||||
c <- catObject sha
|
c <- catObject sha
|
||||||
liftIO $ L.writeFile tmp c
|
liftIO $ L.writeFile tmp c
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue