avoid using CopyFile
If .git/config symlinks are ever a thing, this will handle them better. But mostly, this is to avoid git-repair needing to include CopyFile, which would complicate it unduely.
This commit is contained in:
parent
6b0d732746
commit
75d29de8d4
1 changed files with 2 additions and 5 deletions
|
@ -42,7 +42,6 @@ import Utility.Directory.Create
|
||||||
import Utility.Tmp.Dir
|
import Utility.Tmp.Dir
|
||||||
import Utility.Rsync
|
import Utility.Rsync
|
||||||
import Utility.FileMode
|
import Utility.FileMode
|
||||||
import Utility.CopyFile
|
|
||||||
import qualified Utility.RawFilePath as R
|
import qualified Utility.RawFilePath as R
|
||||||
|
|
||||||
import qualified Data.Set as S
|
import qualified Data.Set as S
|
||||||
|
@ -116,12 +115,10 @@ retrieveMissingObjects missing referencerepo r
|
||||||
| otherwise = withTmpDir "tmprepo" $ \tmpdir -> do
|
| otherwise = withTmpDir "tmprepo" $ \tmpdir -> do
|
||||||
unlessM (boolSystem "git" [Param "init", File tmpdir]) $
|
unlessM (boolSystem "git" [Param "init", File tmpdir]) $
|
||||||
error $ "failed to create temp repository in " ++ tmpdir
|
error $ "failed to create temp repository in " ++ tmpdir
|
||||||
let repoconfig r' = fromRawFilePath (localGitDir r' P.</> "config")
|
|
||||||
tmpr <- Config.read =<< Construct.fromPath (toRawFilePath tmpdir)
|
tmpr <- Config.read =<< Construct.fromPath (toRawFilePath tmpdir)
|
||||||
|
let repoconfig r' = fromRawFilePath (localGitDir r' P.</> "config")
|
||||||
whenM (doesFileExist (repoconfig r)) $
|
whenM (doesFileExist (repoconfig r)) $
|
||||||
void $ copyFileExternal CopyAllMetaData
|
L.readFile (repoconfig r) >>= L.writeFile (repoconfig tmpr)
|
||||||
(repoconfig r)
|
|
||||||
(repoconfig tmpr)
|
|
||||||
rs <- Construct.fromRemotes r
|
rs <- Construct.fromRemotes r
|
||||||
stillmissing <- pullremotes tmpr rs fetchrefstags missing
|
stillmissing <- pullremotes tmpr rs fetchrefstags missing
|
||||||
if S.null (knownMissing stillmissing)
|
if S.null (knownMissing stillmissing)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue