Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of git://github.com/henon/GitSharp

  • Loading branch information...
commit dbd132647b1fd14c19ff0170d39ecc02c4c8347f 2 parents 7fc563c + fed9535
@slluis authored
Showing with 11 additions and 50 deletions.
  1. +3 −14 GitSharp.Core/GitSharp.Core.csproj
  2. +8 −36 GitSharp.Core/PackFile.cs
View
17 GitSharp.Core/GitSharp.Core.csproj
@@ -19,23 +19,17 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
- <OutputPath>..\build\mono-2.0-debug\bin</OutputPath>
+ <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\GitSharp.Core.XML</DocumentationFile>
<NoWarn>1591</NoWarn>
- <CustomCommands>
- <CustomCommands>
- <Command type="BeforeBuild" command="nant -D:project.sources.path=${ProjectDir} init create-assembly-info" workingdir="${SolutionDir}" externalConsole="true" />
- <Command type="AfterBuild" command="nant -D:project.sources.path=${ProjectDir} init cleanup-assembly-info" workingdir="${SolutionDir}" externalConsole="true" />
- </CustomCommands>
- </CustomCommands>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
- <OutputPath>..\build\mono-2.0-debug\bin</OutputPath>
+ <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -55,10 +49,6 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\Tamir.SharpSSH.dll</HintPath>
</Reference>
- <Reference Include="Winterdom.IO.FileMap, Version=2.0.2.0, Culture=neutral, PublicKeyToken=4982617362e1edb5">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\lib\Winterdom.IO.FileMap.dll</HintPath>
- </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AbbreviatedObjectId.cs" />
@@ -379,7 +369,6 @@
<Compile Include="Util\RawCharSequence.cs" />
<Compile Include="Util\RawSubstringPattern.cs" />
<Compile Include="Util\TemporaryBuffer.cs" />
- <Compile Include="VersionAssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="CachedObjectDirectory.cs" />
@@ -442,4 +431,4 @@
</MonoDevelop>
<VisualStudio />
</ProjectExtensions>
-</Project>
+</Project>
View
44 GitSharp.Core/PackFile.cs
@@ -46,7 +46,6 @@
using System.Linq;
using GitSharp.Core.Exceptions;
using GitSharp.Core.Util;
-using Winterdom.IO.FileMap;
namespace GitSharp.Core
{
@@ -470,43 +469,16 @@ internal ByteArrayWindow Read(long pos, int size)
IO.ReadFully(_fd, pos, buf, 0, size);
return new ByteArrayWindow(this, pos, buf);
}
-
+
+ // Note: For now we are going to remove the dependency on Winterdom.IO.FileMap,
+ // since this isn't our default way of packing a file and there isn't any
+ // reason to invest in developing a cross-platform replacement. We're leaving
+ // the rest of the logic in place in case we decide to invest in
+ // this in the future. This was never tested thoroughly and caused
+ // tests to fail when it did run.
internal ByteWindow MemoryMappedByteWindow(long pos, int size)
{
- if (Length < pos + size)
- {
- size = (int) (Length - pos);
- }
-
- Stream map;
-
- using (var _fdMap = MemoryMappedFile.Create(File.FullName, MapProtection.PageReadOnly))
- {
- try
- {
- map = _fdMap.MapView(MapAccess.FileMapRead, pos, size);
- // was: map = _fd.map(MapMode.READ_ONLY, pos, size);
- }
- catch (IOException)
- {
- // The most likely reason this failed is the process has run out
- // of virtual memory. We need to discard quickly, and try to
- // force the GC to finalize and release any existing mappings.
- //
- GC.Collect();
- GC.WaitForPendingFinalizers();
- map = _fdMap.MapView(MapAccess.FileMapRead, pos, size);
- }
-
- byte[] mapArray = map != null ? map.toArray() : new byte[0];
-
- if (mapArray.Length > 0)
- {
- return new ByteArrayWindow(this, pos, mapArray);
- }
- }
-
- return new ByteBufferWindow(this, pos, map);
+ throw new NotImplementedException();
}
private void OnOpenPack()
Please sign in to comment.
Something went wrong with that request. Please try again.