-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The 'ident' attribute set to path squashes "$ident:<any bytes except dollor sign>$" to "$ident$" upon checkin, and expands it to "$ident: <blob SHA-1> $" upon checkout. As we have two conversions that affect checkin/checkout paths, clarify how they interact with each other. Signed-off-by: Junio C Hamano <junkio@cox.net>
- Loading branch information
Junio C Hamano
committed
Apr 25, 2007
1 parent
da94faf
commit 3fed15f
Showing
3 changed files
with
252 additions
and
12 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
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
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/sh | ||
|
||
test_description='blob conversion via gitattributes' | ||
|
||
. ./test-lib.sh | ||
|
||
test_expect_success setup ' | ||
{ | ||
echo "*.i ident" | ||
} >.gitattributes && | ||
{ | ||
echo a b c d e f g h i j k l m | ||
echo n o p q r s t u v w x y z | ||
echo '\''$ident$'\'' | ||
} >test && | ||
cat test >test.t && | ||
cat test >test.o && | ||
cat test >test.i && | ||
git add test test.t test.i && | ||
rm -f test test.t test.i && | ||
git checkout -- test test.t test.i | ||
' | ||
|
||
script='s/^\$ident: \([0-9a-f]*\) \$/\1/p' | ||
|
||
test_expect_success check ' | ||
cmp test.o test && | ||
cmp test.o test.t && | ||
# ident should be stripped in the repository | ||
git diff --raw --exit-code :test :test.i && | ||
id=$(git rev-parse --verify :test) && | ||
embedded=$(sed -ne "$script" test.i) && | ||
test "z$id" = "z$embedded" | ||
' | ||
|
||
test_done |