diff options
author | Joey Hess <joey@kitenet.net> | 2013-11-20 13:01:25 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-11-20 13:13:24 -0400 |
commit | 229761fc4397ed3e8b137e65657a2583066d2764 (patch) | |
tree | 23a86559b66c670dbb7f38e4bf0eefc15458be96 /Utility | |
parent | 3ed32d99829ca44abfe43c953800d8d249909997 (diff) | |
download | git-repair-229761fc4397ed3e8b137e65657a2583066d2764.tar.gz |
Write a dummy .git/HEAD if the file is missing, as git otherwise will not treat the repository as a git repo.
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/FileMode.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Utility/FileMode.hs b/Utility/FileMode.hs index 1307d38..46c6a31 100644 --- a/Utility/FileMode.hs +++ b/Utility/FileMode.hs @@ -64,6 +64,10 @@ preventWrite f = modifyFileMode f $ removeModes writeModes allowWrite :: FilePath -> IO () allowWrite f = modifyFileMode f $ addModes [ownerWriteMode] +{- Turns a file's owner read bit back on. -} +allowRead :: FilePath -> IO () +allowRead f = modifyFileMode f $ addModes [ownerReadMode] + {- Allows owner and group to read and write to a file. -} groupSharedModes :: [FileMode] groupSharedModes = |