-
-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
39 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,39 @@ | ||
#!/bin/bash | ||
set -eu -o pipefail | ||
|
||
git init; | ||
|
||
function baseline() { | ||
local test_date=$1 # first argument is the date to test | ||
|
||
git -c section.key="$test_date" config --type=expiry-date section.key && status=0 || status=$? | ||
# git ls-files "$pathspec" && status=0 || status=$? | ||
{ | ||
echo "$test_date" | ||
echo "$status" | ||
} >> baseline.git | ||
} | ||
|
||
# success | ||
|
||
# date formats following to https://git-scm.com/docs/git-log#Documentation/git-log.txt---dateltformatgt | ||
# short | ||
baseline '2022-08-22' | ||
# rfc2822 | ||
baseline 'Thu, 18 Aug 2022 12:45:06 +0800' | ||
# iso8601 | ||
baseline '2022-08-17 22:04:58 +0200' | ||
# iso8601_strict | ||
baseline '2022-08-17T21:43:13+08:00' | ||
# default | ||
baseline 'Thu Sep 04 2022 10:45:06 -0400' | ||
# unix | ||
baseline '123456789' | ||
# raw | ||
baseline '1660874655 +0800' | ||
|
||
# failing | ||
|
||
# empty_input | ||
baseline "" | ||
|
Binary file added
BIN
+8.95 KB
git-date/tests/fixtures/generated-archives/generate_git_date_baseline.tar.xz
Binary file not shown.