diff options
author | nulltoken <emeric.fermas@gmail.com> | 2011-06-07 21:13:10 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2011-06-07 21:13:10 +0400 |
commit | c52db7dfc77cf31616dfe1feb0fbbfd9cff98ce4 (patch) | |
tree | a6d7794b42fc21cda82f561d9c1252dfcf1d3f34 | |
parent | d76a80152e99653a6b5eef8df1af70705a82cc00 (diff) |
Update libgit2 binaries to a5aa5bd
-rw-r--r-- | Lib/git2.dll | bin | 138240 -> 185856 bytes | |||
-rw-r--r-- | LibGit2Sharp/Core/GitErrorCode.cs | 69 | ||||
-rw-r--r-- | LibGit2Sharp/Core/GitRepositoryPathId.cs | 10 | ||||
-rw-r--r-- | LibGit2Sharp/Core/NativeMethods.cs | 11 | ||||
-rw-r--r-- | LibGit2Sharp/Index.cs | 2 | ||||
-rw-r--r-- | LibGit2Sharp/LibGit2Sharp.csproj | 1 | ||||
-rw-r--r-- | LibGit2Sharp/Repository.cs | 6 | ||||
m--------- | libgit2 | 0 |
8 files changed, 56 insertions, 43 deletions
diff --git a/Lib/git2.dll b/Lib/git2.dll Binary files differindex 3ab2a3b5..95c21676 100644 --- a/Lib/git2.dll +++ b/Lib/git2.dll diff --git a/LibGit2Sharp/Core/GitErrorCode.cs b/LibGit2Sharp/Core/GitErrorCode.cs index ef015a32..6458d745 100644 --- a/LibGit2Sharp/Core/GitErrorCode.cs +++ b/LibGit2Sharp/Core/GitErrorCode.cs @@ -18,136 +18,141 @@ /// <summary> /// Input was not a properly formatted Git object id. /// </summary> - GIT_ENOTOID = (GIT_ERROR - 1), + GIT_ENOTOID = -2, /// <summary> /// Input does not exist in the scope searched. /// </summary> - GIT_ENOTFOUND = (GIT_ERROR - 2), + GIT_ENOTFOUND = -3, /// <summary> /// Not enough space available. /// </summary> - GIT_ENOMEM = (GIT_ERROR - 3), + GIT_ENOMEM = -4, /// <summary> /// Consult the OS error information. /// </summary> - GIT_EOSERR = (GIT_ERROR - 4), + GIT_EOSERR = -5, /// <summary> /// The specified object is of invalid type /// </summary> - GIT_EOBJTYPE = (GIT_ERROR - 5), - - /// <summary> - /// The specified object has its data corrupted - /// </summary> - GIT_EOBJCORRUPTED = (GIT_ERROR - 6), + GIT_EOBJTYPE = -6, /// <summary> /// The specified repository is invalid /// </summary> - GIT_ENOTAREPO = (GIT_ERROR - 7), + GIT_ENOTAREPO = -7, /// <summary> /// The object type is invalid or doesn't match /// </summary> - GIT_EINVALIDTYPE = (GIT_ERROR - 8), + GIT_EINVALIDTYPE = -8, /// <summary> /// The object cannot be written that because it's missing internal data /// </summary> - GIT_EMISSINGOBJDATA = (GIT_ERROR - 9), + GIT_EMISSINGOBJDATA = -9, /// <summary> /// The packfile for the ODB is corrupted /// </summary> - GIT_EPACKCORRUPTED = (GIT_ERROR - 10), + GIT_EPACKCORRUPTED = -10, /// <summary> /// Failed to adquire or release a file lock /// </summary> - GIT_EFLOCKFAIL = (GIT_ERROR - 11), + GIT_EFLOCKFAIL = -11, /// <summary> /// The Z library failed to inflate/deflate an object's data /// </summary> - GIT_EZLIB = (GIT_ERROR - 12), + GIT_EZLIB = -12, /// <summary> /// The queried object is currently busy /// </summary> - GIT_EBUSY = (GIT_ERROR - 13), + GIT_EBUSY = -13, /// <summary> /// The index file is not backed up by an existing repository /// </summary> - GIT_EBAREINDEX = (GIT_ERROR - 14), + GIT_EBAREINDEX = -14, /// <summary> /// The name of the reference is not valid /// </summary> - GIT_EINVALIDREFNAME = (GIT_ERROR - 15), + GIT_EINVALIDREFNAME = -15, /// <summary> /// The specified reference has its data corrupted /// </summary> - GIT_EREFCORRUPTED = (GIT_ERROR - 16), + GIT_EREFCORRUPTED = -16, /// <summary> /// The specified symbolic reference is too deeply nested /// </summary> - GIT_ETOONESTEDSYMREF = (GIT_ERROR - 17), + GIT_ETOONESTEDSYMREF = -17, /// <summary> /// The pack-refs file is either corrupted of its format is not currently supported /// </summary> - GIT_EPACKEDREFSCORRUPTED = (GIT_ERROR - 18), + GIT_EPACKEDREFSCORRUPTED = -18, /// <summary> /// The path is invalid /// </summary> - GIT_EINVALIDPATH = (GIT_ERROR - 19), + GIT_EINVALIDPATH = -19, /// <summary> /// The revision walker is empty; there are no more commits left to iterate /// </summary> - GIT_EREVWALKOVER = (GIT_ERROR - 20), + GIT_EREVWALKOVER = -20, /// <summary> /// The state of the reference is not valid /// </summary> - GIT_EINVALIDREFSTATE = (GIT_ERROR - 21), + GIT_EINVALIDREFSTATE = -21, /// <summary> /// This feature has not been implemented yet /// </summary> - GIT_ENOTIMPLEMENTED = (GIT_ERROR - 22), + GIT_ENOTIMPLEMENTED = -22, /// <summary> /// A reference with this name already exists /// </summary> - GIT_EEXISTS = (GIT_ERROR - 23), + GIT_EEXISTS = -23, /// <summary> /// The given integer literal is too large to be parsed /// </summary> - GIT_EOVERFLOW = (GIT_ERROR - 24), + GIT_EOVERFLOW = -24, /// <summary> /// The given literal is not a valid number /// </summary> - GIT_ENOTNUM = (GIT_ERROR - 25), + GIT_ENOTNUM = -25, /// <summary> /// Streaming error /// </summary> - GIT_ESTREAM = (GIT_ERROR - 26), + GIT_ESTREAM = -26, /// <summary> /// invalid arguments to function /// </summary> - GIT_EINVALIDARGS = (GIT_ERROR - 27), - } + GIT_EINVALIDARGS = -27, + + /// <summary> + /// The specified object has its data corrupted + /// </summary> + GIT_EOBJCORRUPTED = -28, + + /// <summary> + /// The given short oid is ambiguous + /// </summary> + GIT_EAMBIGUOUSOIDPREFIX = -29, +} }
\ No newline at end of file diff --git a/LibGit2Sharp/Core/GitRepositoryPathId.cs b/LibGit2Sharp/Core/GitRepositoryPathId.cs new file mode 100644 index 00000000..96ab86d5 --- /dev/null +++ b/LibGit2Sharp/Core/GitRepositoryPathId.cs @@ -0,0 +1,10 @@ +namespace LibGit2Sharp.Core +{ + internal enum GitRepositoryPathId + { + GIT_REPO_PATH, + GIT_REPO_PATH_INDEX, + GIT_REPO_PATH_ODB, + GIT_REPO_PATH_WORKDIR + } +}
\ No newline at end of file diff --git a/LibGit2Sharp/Core/NativeMethods.cs b/LibGit2Sharp/Core/NativeMethods.cs index 1e1550e3..fdac1e28 100644 --- a/LibGit2Sharp/Core/NativeMethods.cs +++ b/LibGit2Sharp/Core/NativeMethods.cs @@ -59,9 +59,6 @@ namespace LibGit2Sharp.Core public static extern int git_index_remove(IndexSafeHandle index, int n); [DllImport(libgit2)] - public static extern int git_index_open_inrepo(out IndexSafeHandle index, RepositorySafeHandle repo); - - [DllImport(libgit2)] public static extern int git_index_write(IndexSafeHandle index); [DllImport(libgit2)] @@ -147,6 +144,9 @@ namespace LibGit2Sharp.Core public static extern void git_repository_free(IntPtr repository); [DllImport(libgit2)] + public static extern int git_repository_index(out IndexSafeHandle index, RepositorySafeHandle repo); + + [DllImport(libgit2)] public static extern int git_repository_init(out RepositorySafeHandle repository, string path, [MarshalAs(UnmanagedType.Bool)] bool isBare); [DllImport(libgit2)] @@ -157,10 +157,7 @@ namespace LibGit2Sharp.Core public static extern int git_repository_open(out RepositorySafeHandle repository, string path); [DllImport(libgit2)] - public static extern IntPtr git_repository_path(RepositorySafeHandle repository); - - [DllImport(libgit2)] - public static extern IntPtr git_repository_workdir(RepositorySafeHandle repository); + public static extern IntPtr git_repository_path(RepositorySafeHandle repository, GitRepositoryPathId pathIdentifier); [DllImport(libgit2)] public static extern void git_revwalk_free(IntPtr walker); diff --git a/LibGit2Sharp/Index.cs b/LibGit2Sharp/Index.cs index 7b051a31..5513a345 100644 --- a/LibGit2Sharp/Index.cs +++ b/LibGit2Sharp/Index.cs @@ -15,7 +15,7 @@ namespace LibGit2Sharp internal Index(Repository repo) { this.repo = repo; - var res = NativeMethods.git_index_open_inrepo(out handle, repo.Handle); + var res = NativeMethods.git_repository_index(out handle, repo.Handle); Ensure.Success(res); } diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index 2658dc7f..7dc258db 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -55,6 +55,7 @@ <Compile Include="Core\GitObjectTypeMap.cs" /> <Compile Include="Core\GitOid.cs" /> <Compile Include="Core\GitReferenceType.cs" /> + <Compile Include="Core\GitRepositoryPathId.cs" /> <Compile Include="Core\GitSignature.cs" /> <Compile Include="Core\GitTime.cs" /> <Compile Include="Core\IntPtrExtensions.cs" /> diff --git a/LibGit2Sharp/Repository.cs b/LibGit2Sharp/Repository.cs index 63d77e1a..7600c7ea 100644 --- a/LibGit2Sharp/Repository.cs +++ b/LibGit2Sharp/Repository.cs @@ -27,8 +27,8 @@ namespace LibGit2Sharp var res = NativeMethods.git_repository_open(out handle, PosixPathHelper.ToPosix(path)); Ensure.Success(res); - string normalizedPath = NativeMethods.git_repository_path(handle).MarshallAsString(); - string normalizedWorkDir = NativeMethods.git_repository_workdir(handle).MarshallAsString(); + string normalizedPath = NativeMethods.git_repository_path(handle, GitRepositoryPathId.GIT_REPO_PATH).MarshallAsString(); + string normalizedWorkDir = NativeMethods.git_repository_path(handle, GitRepositoryPathId.GIT_REPO_PATH_WORKDIR).MarshallAsString(); Info = new RepositoryInformation(this, normalizedPath, normalizedWorkDir, normalizedWorkDir == null); @@ -164,7 +164,7 @@ namespace LibGit2Sharp var res = NativeMethods.git_repository_init(out repo, PosixPathHelper.ToPosix(path), bare); Ensure.Success(res); - string normalizedPath = NativeMethods.git_repository_path(repo).MarshallAsString(); + string normalizedPath = NativeMethods.git_repository_path(repo, GitRepositoryPathId.GIT_REPO_PATH).MarshallAsString(); repo.Dispose(); return PosixPathHelper.ToNative(normalizedPath); diff --git a/libgit2 b/libgit2 -Subproject cd2cc2dc363770d03a9d77206b97d0ee70244ca +Subproject a5aa5bd1d111e7b2cd2e807664cef6f1e91718c |