]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t7700: do not use "touch" unnecessarily
authorJeff King <peff@peff.net>
Thu, 23 Jan 2014 19:55:18 +0000 (14:55 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 23 Jan 2014 21:13:20 +0000 (13:13 -0800)
Some versions of touch (such as /usr/ucb/touch on Solaris)
do not know about the "-r" option. This would make sense as
a feature of test-chmtime, but fortunately this fix is even
easier.

The test does not care about the timestamp of the .keep file it
creates at all, only that it exists. For such a use case, with or
without portability issues around "-r", "touch" should not be used
in the first place.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7700-repack.sh

index d954b846a17d6374dd8c7dae7f901170ff3c8c24..b45bd1e76cd24940545706c8f5611adce9b3803e 100755 (executable)
@@ -17,7 +17,7 @@ test_expect_success 'objects in packs marked .keep are not repacked' '
        # The second pack will contain the excluded object
        packsha1=$(git rev-list --objects --all | grep file2 |
                git pack-objects pack) &&
-       touch -r pack-$packsha1.pack pack-$packsha1.keep &&
+       >pack-$packsha1.keep &&
        objsha1=$(git verify-pack -v pack-$packsha1.idx | head -n 1 |
                sed -e "s/^\([0-9a-f]\{40\}\).*/\1/") &&
        mv pack-* .git/objects/pack/ &&