Browse Source

git-remote-mediawiki: use --force when adding notes

When notes are created to record a push, it normally doesn't exist yet.
However, when a push is interrupted and then restarted, it may happen
that a commit already has notes attached, and we want to reflect the newly
created remote revision, hence use 'git notes add -f' to override the
existing one

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Matthieu Moy 13 years ago committed by Junio C Hamano
parent
commit
5c481745fb
  1. 2
      contrib/mw-to-git/git-remote-mediawiki

2
contrib/mw-to-git/git-remote-mediawiki

@ -1263,7 +1263,7 @@ sub mw_push_revision { @@ -1263,7 +1263,7 @@ sub mw_push_revision {
}
}
unless ($dumb_push) {
run_git("notes --ref=$remotename/mediawiki add -m \"mediawiki_revision: $mw_revision\" $sha1_commit");
run_git("notes --ref=$remotename/mediawiki add -f -m \"mediawiki_revision: $mw_revision\" $sha1_commit");
run_git("update-ref -m \"Git-MediaWiki push\" refs/mediawiki/$remotename/master $sha1_commit $sha1_child");
}
}

Loading…
Cancel
Save