From: Matthieu Moy Date: Mon, 16 Jul 2012 19:46:39 +0000 (+0200) Subject: git-remote-mediawiki: use --force when adding notes X-Git-Tag: v1.7.12-rc0~8^2~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5c481745fbed5aa0eb63726c9e05538ededa63bb;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/contrib/mw-to-git/git-remote-mediawiki b/contrib/mw-to-git/git-remote-mediawiki index fb1e9e09e..517a4db3f 100755 --- a/contrib/mw-to-git/git-remote-mediawiki +++ b/contrib/mw-to-git/git-remote-mediawiki @@ -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"); } }