]> git.notmuchmail.org Git - notmuch/commitdiff
nmbug: replace hard-coded magic hash with git-hash-object
authorDavid Bremner <bremner@debian.org>
Wed, 20 Feb 2013 22:24:36 +0000 (18:24 -0400)
committerDavid Bremner <bremner@debian.org>
Sat, 2 Mar 2013 14:42:27 +0000 (10:42 -0400)
This is at least easier to understand than the magic hash. It may also
be a bit more robust, although it is hard to imagine these numbers
changing without many other changes in git.

devel/nmbug/nmbug

index 73d64fe5f90735cdd3c0ede8efec62889ab62896..b9c70e4b205d168ce72ac3273e032c45b6e77de7 100755 (executable)
@@ -15,9 +15,6 @@ $NMBGIT .= '/.git' if (-d $NMBGIT.'/.git');
 
 my $TAGPREFIX = $ENV{NMBPREFIX} || 'notmuch::';
 
-# magic hash for git
-my $EMPTYBLOB = 'e69de29bb2d1d6434b8b29ae775ad8c2e48c5391';
-
 # for encoding
 
 my $ESCAPE_CHAR =      '%';
@@ -50,6 +47,9 @@ if (!exists $command{$subcommand}) {
   usage ();
 }
 
+# magic hash for git
+my $EMPTYBLOB = git (qw{hash-object -t blob /dev/null});
+
 &{$command{$subcommand}}(@ARGV);
 
 sub git_pipe {