check_no_unwanted_metadata('HEAD')
if $current->{Kind} ne 'tip';
+run_git_check_nooutput('cannot create new topbloke branch with staged files',
+ qw(diff --cached --name-only HEAD --));
+
# For the metadata files in .topbloke, we hope that the user
# doesn't modify them. If they do then they get to keep all the pieces.
#
# For .topbloke/msg, if it's modified by the user (ie, if working
-# version differs from HEAD) we keep that, and we stage it unless
-# the cached version differs from the HEAD.
+# version differs from HEAD) we keep that and stage it.
my $newbranch = "$spec->{Email}\@$spec->{Domain}/$spec->{Date}/$spec->{Nick}";
setup_config();
-run_git__anyoutput(qw(diff --cached --name-only HEAD --
+my $user_edited_msg =
+ run_git_test_anyoutput(qw(diff --name-only HEAD -- .topbloke/msg));
+
+my $baseref = "refs/topbloke-bases/$newbranch";
+run_git(qw(update-ref -m), "tb-create base", $baseref, 'HEAD');
+
+open GIT, "|-", 'git', qw(update-index --index-info) or die $!;
+foreach my $file (qw(msg deps)) {
+ run_git(qw(update-index --cacheinfo 0644), $notapplicable_sha1,
+ ".topbloke/$file");
+
+
-if (!run_git_test_anyoutput(qw(diff --name-only HEAD -- .topbloke/msg)) {
my $nm = wf_start('.topbloke/msg');
my $author = run_git_1line(qw(var GIT_AUTHOR_IDENT));
$author =~ s/ \d+ [-+]\d+$//;