Make Rider a bit happier (#3)

This commit is contained in:
Patrick Stevens
2022-09-03 09:13:21 +01:00
committed by GitHub
parent f499468dd4
commit aa7a73f506
9 changed files with 19 additions and 15 deletions

View File

@@ -20,7 +20,7 @@ module TestInit =
gitDir.Create ()
let r =
let _ =
match Repository.init gitDir with
| Ok r -> r
| Error r -> failwithf "Failed to init repo: %+A" r

5
Git.sln.DotSettings Normal file
View File

@@ -0,0 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=FSharpInterpolatedString/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=FSharpRedundantDotInIndexer/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Chacon/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=failwithf/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

View File

@@ -120,7 +120,7 @@ module Commit =
| Some hash -> hash |> Hash.ofSpelling
let consumeLabelledHash (expecting : OneOf) : string * Hash =
let w = consumeWord (expecting)
let w = consumeWord expecting
let h = consumeHash w
w, h

View File

@@ -99,7 +99,7 @@ module EncodedObject =
let objectName = hashStr.[2..]
let subDir = hashStr.[0..1]
let d = Repository.createSubdir (Repository.objectDir r) subDir
let d = Repository.createSubDir (Repository.objectDir r) subDir
use filestream = r.Fs.File.Create (r.Fs.Path.Combine (d.FullName, objectName))
compress o filestream

View File

@@ -50,7 +50,7 @@ module Hash =
let rec b (pos : int) =
seq {
if pos < input.Length then
yield value (input.[pos]) * 16uy + value input.[pos + 1]
yield value input.[pos] * 16uy + value input.[pos + 1]
yield! b (pos + 2)
}

View File

@@ -30,7 +30,7 @@ module Repository =
r.Fs.Path.Combine ((gitDir r).FullName, "refs")
|> r.Fs.DirectoryInfo.FromDirectoryName
let internal createSubdir (r : IDirectoryInfo) (name : string) : IDirectoryInfo =
let internal createSubDir (r : IDirectoryInfo) (name : string) : IDirectoryInfo =
let output =
r.FileSystem.Path.Combine (r.FullName, name)
|> r.FileSystem.DirectoryInfo.FromDirectoryName
@@ -64,12 +64,12 @@ module Repository =
else
// TODO do this atomically
let gitDir = createSubdir dir ".git"
let objectDir = createSubdir gitDir "objects"
let _packDir = createSubdir objectDir "pack"
let _infoDir = createSubdir objectDir "info"
let refsDir = createSubdir gitDir "refs"
let _headsDir = createSubdir refsDir "heads"
let _tagsDir = createSubdir refsDir "tags"
let gitDir = createSubDir dir ".git"
let objectDir = createSubDir gitDir "objects"
let _packDir = createSubDir objectDir "pack"
let _infoDir = createSubDir objectDir "info"
let refsDir = createSubDir gitDir "refs"
let _headsDir = createSubDir refsDir "heads"
let _tagsDir = createSubDir refsDir "tags"
make dir |> Option.get |> Ok

View File

@@ -52,5 +52,5 @@ module internal Stream =
let consumeToEnd (b : MemoryStream) : byte array =
use newMs = new MemoryStream ()
b.CopyTo (newMs)
b.CopyTo newMs
newMs.ToArray ()

View File

@@ -12,7 +12,7 @@ type SymbolicRef =
| MergeHead
| Head
| OrigHead
// TODO - determine how an arbitrary symbolicref actually behaves
// TODO - determine how an arbitrary symbolic ref actually behaves
| Verbatim of string
override this.ToString () : string =

View File

@@ -1,7 +1,6 @@
namespace Git
open System
open System.Collections.Generic
open System.IO
open System.Text
open Git.Internals