]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Meta/cook: hack to allow "Meta/cook -w HEAD~$n" to work
authorJunio C Hamano <gitster@pobox.com>
Fri, 25 Jan 2013 22:40:25 +0000 (14:40 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 25 Jan 2013 22:40:25 +0000 (14:40 -0800)
cook

diff --git a/cook b/cook
index f0ccda0808acda0131ec8ae81cc77448413f72fb..a6cee64a3d55527bf865f3f9b001ec40b2f76204 100755 (executable)
--- a/cook
+++ b/cook
@@ -864,9 +864,10 @@ if ($wildo) {
        } elsif (@ARGV != 1) {
                print STDERR "$0 --wildo [filename|HEAD]\n";
                exit 1;
-       } elsif ($ARGV[0] eq "HEAD") {
+       } elsif ($ARGV[0] =~ /^HEAD/) {
                open($fd, "-|",
-                    qw(git --git-dir=Meta/.git cat-file -p HEAD:whats-cooking.txt));
+                    qw(git --git-dir=Meta/.git cat-file -p),
+                    "$ARGV[0]:whats-cooking.txt");
        } else {
                open($fd, "<", $ARGV[0]);
        }