Skip to content

Commit

Permalink
Move to latest libgit2 with PR #6706 merged
Browse files Browse the repository at this point in the history
With libgit2/libgit2#6706 merged in we can now
use libgit2 from master. Small changes were needed.

This is needed in order to have stable hashes for e2e tests.

Previously we needed to use a patched version from:
https://github.com/u-quark/libgit2/commits/gg
  • Loading branch information
u-quark committed Jul 24, 2024
1 parent afed944 commit 1605ae0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
flake = false;
};
libgit2 = {
url = "github:u-quark/libgit2?ref=gg";
url = "github:libgit2/libgit2?ref=503b66cf";
flake = false;
};
vty = {
Expand Down
2 changes: 1 addition & 1 deletion src/GG/Repo/Commit.hs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ getSignature commitContent program keyM = do
createCommit :: G.Repository -> G.Signature -> String -> G.Tree -> [G.Commit] -> IO CreateCommitResult
createCommit repo author message tree parents = do
signConfig <- getSignConfig repo
committer <- G.signatureDefaultCommitter repo
(_author, committer) <- G.signatureDefaultFromEnv repo
commitContent <- G.commitCreateBuffer repo author committer "UTF-8" message tree parents
signatureME <-
case signConfig of
Expand Down
7 changes: 2 additions & 5 deletions src/Libgit2/Signature.chs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ module Libgit2.Signature
, signatureName
, signatureEmail
, signatureWhen
, signatureDefaultAuthor
, signatureDefaultCommitter
, signatureDefaultFromEnv
) where

{#import Libgit2.Types#}
Expand Down Expand Up @@ -53,6 +52,4 @@ signatureWhen (Signature fp) =
pure $ gitToLocalTime time offset
)

{#fun signature_default_author as signatureDefaultAuthor { alloca- `Signature' peekNewSignature*, `Repository' } -> `Int' checkReturnCode*-#}

{#fun signature_default_committer as signatureDefaultCommitter { alloca- `Signature' peekNewSignature*, `Repository' } -> `Int' checkReturnCode*-#}
{#fun signature_default_from_env as signatureDefaultFromEnv { alloca- `Signature' peekNewSignature*, alloca- `Signature' peekNewSignature*, `Repository' } -> `Int' checkReturnCode*-#}

0 comments on commit 1605ae0

Please sign in to comment.