\r
#include "stdafx.h"\r
#include "gitdll.h"\r
-\r
+#include "cache.h"\r
#if 0\r
\r
// This is an example of an exported variable\r
int git_get_sha1(const char *name, unsigned char *sha1)\r
{\r
return get_sha1(name,sha1);\r
+}\r
+\r
+static int convert_slash(char * path)\r
+{\r
+ while(*path)\r
+ {\r
+ if(*path == '\\' )\r
+ *path = '/';\r
+ path++;\r
+ }\r
+}\r
+int git_init()\r
+{\r
+ char *home;\r
+ char path[MAX_PATH+1];\r
+ char *prefix;\r
+ size_t homesize,size,httpsize;\r
+\r
+ // set HOME if not set already\r
+ getenv_s(&homesize, NULL, 0, "HOME");\r
+ if (!homesize)\r
+ {\r
+ _dupenv_s(&home,&size,"USERPROFILE"); \r
+ _putenv_s("HOME",home);\r
+ free(home);\r
+ }\r
+ GetModuleFileName(NULL, path, MAX_PATH);\r
+ convert_slash(path);\r
+\r
+ git_extract_argv0_path(path);\r
+ prefix = setup_git_directory();\r
+ git_config(git_default_config, NULL);\r
}
\ No newline at end of file
GITDLL_API int fngitdll(void);\r
\r
GITDLL_API char * get_git_last_error();\r
-GITDLL_API int git_get_sha1(const char *name, unsigned char *sha1);
\ No newline at end of file
+GITDLL_API int git_get_sha1(const char *name, unsigned char *sha1);\r
+GITDLL_API int git_init();
\ No newline at end of file
OutputDirectory="$(SolutionDir)\..\bin\$(ConfigurationName)\bin"\r
IntermediateDirectory="$(ConfigurationName)"\r
ConfigurationType="2"\r
- CharacterSet="1"\r
+ CharacterSet="0"\r
>\r
<Tool\r
Name="VCPreBuildEventTool"\r
<Tool\r
Name="VCCLCompilerTool"\r
Optimization="0"\r
+ AdditionalIncludeDirectories="..\tgit;..\tgit\compat;..\tgit\compat\vcbuild;;..\tgit\compat\vcbuild\include;..\tgit\compat\fnmatch;..\tgit\compat\regex;..\zlib;"\r
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;GITDLL_EXPORTS"\r
MinimalRebuild="true"\r
BasicRuntimeChecks="3"\r
/>\r
</Configuration>\r
<Configuration\r
- Name="Release|Win32"\r
- OutputDirectory="$(SolutionDir)\..\bin\$(ConfigurationName)\bin"\r
- IntermediateDirectory="$(ConfigurationName)"\r
+ Name="Debug|x64"\r
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
ConfigurationType="2"\r
CharacterSet="1"\r
- WholeProgramOptimization="1"\r
>\r
<Tool\r
Name="VCPreBuildEventTool"\r
/>\r
<Tool\r
Name="VCMIDLTool"\r
+ TargetEnvironment="3"\r
/>\r
<Tool\r
Name="VCCLCompilerTool"\r
- Optimization="2"\r
- EnableIntrinsicFunctions="true"\r
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;GITDLL_EXPORTS"\r
- RuntimeLibrary="2"\r
- EnableFunctionLevelLinking="true"\r
+ Optimization="0"\r
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;GITDLL_EXPORTS"\r
+ MinimalRebuild="true"\r
+ BasicRuntimeChecks="3"\r
+ RuntimeLibrary="3"\r
UsePrecompiledHeader="0"\r
WarningLevel="3"\r
DebugInformationFormat="3"\r
<Tool\r
Name="VCLinkerTool"\r
AdditionalDependencies="wininet.lib ws2_32.lib "\r
- LinkIncremental="1"\r
+ LinkIncremental="2"\r
GenerateDebugInformation="true"\r
SubSystem="2"\r
- OptimizeReferences="2"\r
- EnableCOMDATFolding="2"\r
- TargetMachine="1"\r
+ TargetMachine="17"\r
/>\r
<Tool\r
Name="VCALinkTool"\r
/>\r
</Configuration>\r
<Configuration\r
- Name="Debug|x64"\r
- OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"\r
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ Name="Release|Win32"\r
+ OutputDirectory="$(SolutionDir)\..\bin\$(ConfigurationName)\bin"\r
+ IntermediateDirectory="$(ConfigurationName)"\r
ConfigurationType="2"\r
CharacterSet="1"\r
+ WholeProgramOptimization="1"\r
>\r
<Tool\r
Name="VCPreBuildEventTool"\r
/>\r
<Tool\r
Name="VCMIDLTool"\r
- TargetEnvironment="3"\r
/>\r
<Tool\r
Name="VCCLCompilerTool"\r
- Optimization="0"\r
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;GITDLL_EXPORTS"\r
- MinimalRebuild="true"\r
- BasicRuntimeChecks="3"\r
- RuntimeLibrary="3"\r
+ Optimization="2"\r
+ EnableIntrinsicFunctions="true"\r
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;GITDLL_EXPORTS"\r
+ RuntimeLibrary="2"\r
+ EnableFunctionLevelLinking="true"\r
UsePrecompiledHeader="0"\r
WarningLevel="3"\r
DebugInformationFormat="3"\r
<Tool\r
Name="VCLinkerTool"\r
AdditionalDependencies="wininet.lib ws2_32.lib "\r
- LinkIncremental="2"\r
+ LinkIncremental="1"\r
GenerateDebugInformation="true"\r
SubSystem="2"\r
- TargetMachine="17"\r
+ OptimizeReferences="2"\r
+ EnableCOMDATFolding="2"\r
+ TargetMachine="1"\r
/>\r
<Tool\r
Name="VCALinkTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
{\r
unsigned char hash[20];\r
int ret;\r
+ ret=git_init();\r
ret=git_get_sha1("master",hash);\r
return ret;\r
}\r
OutputDirectory="$(SolutionDir)\..\bin\$(ConfigurationName)\bin"\r
IntermediateDirectory="$(ConfigurationName)"\r
ConfigurationType="1"\r
- CharacterSet="1"\r
+ CharacterSet="0"\r
>\r
<Tool\r
Name="VCPreBuildEventTool"\r
/>\r
</Configuration>\r
<Configuration\r
- Name="Release|Win32"\r
- OutputDirectory="$(SolutionDir)\..\bin\$(ConfigurationName)"\r
- IntermediateDirectory="$(ConfigurationName)"\r
+ Name="Debug|x64"\r
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
ConfigurationType="1"\r
CharacterSet="1"\r
- WholeProgramOptimization="1"\r
>\r
<Tool\r
Name="VCPreBuildEventTool"\r
/>\r
<Tool\r
Name="VCMIDLTool"\r
+ TargetEnvironment="3"\r
/>\r
<Tool\r
Name="VCCLCompilerTool"\r
- Optimization="2"\r
- EnableIntrinsicFunctions="true"\r
+ Optimization="0"\r
AdditionalIncludeDirectories="..\gitdll"\r
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"\r
- RuntimeLibrary="2"\r
- EnableFunctionLevelLinking="true"\r
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"\r
+ MinimalRebuild="true"\r
+ BasicRuntimeChecks="3"\r
+ RuntimeLibrary="3"\r
UsePrecompiledHeader="2"\r
WarningLevel="3"\r
DebugInformationFormat="3"\r
/>\r
<Tool\r
Name="VCLinkerTool"\r
- LinkIncremental="1"\r
+ LinkIncremental="2"\r
GenerateDebugInformation="true"\r
SubSystem="1"\r
- OptimizeReferences="2"\r
- EnableCOMDATFolding="2"\r
- TargetMachine="1"\r
+ TargetMachine="17"\r
/>\r
<Tool\r
Name="VCALinkTool"\r
/>\r
</Configuration>\r
<Configuration\r
- Name="Debug|x64"\r
- OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"\r
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ Name="Release|Win32"\r
+ OutputDirectory="$(SolutionDir)\..\bin\$(ConfigurationName)"\r
+ IntermediateDirectory="$(ConfigurationName)"\r
ConfigurationType="1"\r
CharacterSet="1"\r
+ WholeProgramOptimization="1"\r
>\r
<Tool\r
Name="VCPreBuildEventTool"\r
/>\r
<Tool\r
Name="VCMIDLTool"\r
- TargetEnvironment="3"\r
/>\r
<Tool\r
Name="VCCLCompilerTool"\r
- Optimization="0"\r
+ Optimization="2"\r
+ EnableIntrinsicFunctions="true"\r
AdditionalIncludeDirectories="..\gitdll"\r
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"\r
- MinimalRebuild="true"\r
- BasicRuntimeChecks="3"\r
- RuntimeLibrary="3"\r
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"\r
+ RuntimeLibrary="2"\r
+ EnableFunctionLevelLinking="true"\r
UsePrecompiledHeader="2"\r
WarningLevel="3"\r
DebugInformationFormat="3"\r
/>\r
<Tool\r
Name="VCLinkerTool"\r
- LinkIncremental="2"\r
+ LinkIncremental="1"\r
GenerateDebugInformation="true"\r
SubSystem="1"\r
- TargetMachine="17"\r
+ OptimizeReferences="2"\r
+ EnableCOMDATFolding="2"\r
+ TargetMachine="1"\r
/>\r
<Tool\r
Name="VCALinkTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Release|Win32"\r
+ Name="Debug|x64"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r
/>\r
</FileConfiguration>\r
<FileConfiguration\r
- Name="Debug|x64"\r
+ Name="Release|Win32"\r
>\r
<Tool\r
Name="VCCLCompilerTool"\r