-if git-symbolic-ref HEAD >/dev/null 2>&1; then
- refs+=' HEAD'
-
-
-
-my $gfo = `LC_MESSAGES=C git fsck --no-dangling 2>&1`;
-$? == 256 or die "$? $!"
-
-
-
-
- m/^error in commit (\w+):.*invalid format - expected 'committer/;
-
-case `wc -l <$tmp/bad` in
- 0)
- echo >&2 'nothing bad found - is git-fsck doing as we expect?' ;
- exit 8 ;;
- 1)
- read <$tmp/bad bads
- nots="^$bads^0 ^$bads^1"
- ;;
- *)
- bads="cat $tmp/bad"
- ;;
-esac
-
-args="$nots"
-
-refs=`git-for-each-ref --format='%(refname)'`
+for my $up (@updates) {
+ my ($ref, $old, $new) = @$up;
+ my $otherref = $ref;
+ $otherref =~ s{^refs/}{};
+ if ($real) {
+ print U <<END or die $!;
+create refs/dgit-badcommit/$otherref $old
+update $ref $new $old
+END
+ } else {
+ print U <<END or die $!;
+update refs/dgit-badfixuptest/$otherref $new
+END
+ }
+}