-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a test for negative dates and see how onefetch handles it.
Currently there is an 'empty' error which probably is related to a failure to parse commits with negative dates. This should be fixed in future versions of `gitoxide`.
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
set -eu -o pipefail | ||
|
||
git init -q | ||
git checkout -b main | ||
|
||
echo "hello\nworld" >> code.rs | ||
git add code.rs | ||
GIT_AUTHOR_DATE="@0 +0000" GIT_COMMITTER_DATE="@0 +0000" git commit -q -m c1 | ||
git cat-file -p @ > to-be-patched.txt | ||
|
||
patch -p1 <<EOF | ||
diff --git a/to-be-patched.txt b/to-be-patched.txt | ||
index 95ad1b1..3ea89af 100644 | ||
--- a/to-be-patched.txt | ||
+++ b/to-be-patched.txt | ||
@@ -1,5 +1,5 @@ | ||
tree 00d3a67028ba1004a04bd720eee966811102f0c3 | ||
-author author <[email protected]> 0 +0000 | ||
-committer committer <[email protected]> 0 +0000 | ||
+author author <[email protected]> -5263747740 +0009 | ||
+committer committer <[email protected]> -5263747740 +0009 | ||
c1 | ||
EOF | ||
|
||
new_commit=$(git hash-object -w -t commit to-be-patched.txt) | ||
git update-ref refs/heads/main $new_commit | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters