From 82f2567e3d01a6eeb4c6a0b9139232034de6e60f Mon Sep 17 00:00:00 2001 From: Lars Schneider Date: Thu, 28 Apr 2016 08:26:33 +0200 Subject: git-p4: fix Git LFS pointer parsing Git LFS 1.2.0 removed a preamble from the output of the 'git lfs pointer' command [1] which broke the parsing of this output. Adjust the parser to support the old and the new format. Please note that this patch slightly changes the second return parameter from a list of LF terminated strings to a single string that contains a number of LF characters. [1] https://github.com/github/git-lfs/commit/da2935d9a739592bc775c98d8ef4df9c72ea3b43 Signed-off-by: Lars Schneider Helped-by: Sebastian Schuberth Helped-by: Ben Woosley Signed-off-by: Lars Schneider Signed-off-by: Junio C Hamano --- t/t9824-git-p4-git-lfs.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 't') diff --git a/t/t9824-git-p4-git-lfs.sh b/t/t9824-git-p4-git-lfs.sh index 0b664a377c..ca93ac8813 100755 --- a/t/t9824-git-p4-git-lfs.sh +++ b/t/t9824-git-p4-git-lfs.sh @@ -13,6 +13,10 @@ test_file_in_lfs () { FILE="$1" && SIZE="$2" && EXPECTED_CONTENT="$3" && + sed -n '1,1 p' "$FILE" | grep "^version " && + sed -n '2,2 p' "$FILE" | grep "^oid " && + sed -n '3,3 p' "$FILE" | grep "^size " && + test_line_count = 3 "$FILE" && cat "$FILE" | grep "size $SIZE" && HASH=$(cat "$FILE" | grep "oid sha256:" | sed -e "s/oid sha256://g") && LFS_FILE=".git/lfs/objects/$(echo "$HASH" | cut -c1-2)/$(echo "$HASH" | cut -c3-4)/$HASH" && -- cgit v1.2.3