diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2019-07-20 17:17:06 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2019-07-20 23:31:26 +0100 |
commit | e82d9492c0a63d75c96e2ebdbc93300d57927d60 (patch) | |
tree | d704f2377dad8b3eb92a2dcc891b768861d38674 /git-debpush | |
parent | d95dee518855473eb8e10acf749b7275ca34bb0e (diff) |
git-debpush: Check upstream source is identical in the upstream tag
Closes: #932476
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Acked-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'git-debpush')
-rwxr-xr-x | git-debpush | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/git-debpush b/git-debpush index dee358b..1bfb093 100755 --- a/git-debpush +++ b/git-debpush @@ -79,6 +79,11 @@ fail_check () { fi } +fail_check_upstream_nonidentical () { + fail_check upstream-nonidentical \ + "the upstream source in tag $upstream_tag is not identical to the upstream source in $branch" +} + find_last_tag () { local prefix=$1 @@ -92,6 +97,23 @@ find_last_tag () { set -o pipefail } +check_treesame () { + local first=$1 + local second=$2 + shift 2 + + set +e + git diff --exit-code "$first".."$second" -- . "$@" + git_diff_rc=$? + set -e + + if [ $git_diff_rc -le 1 ]; then + return $git_diff_rc + else + fail "'git diff' exited with unexpected code $git_diff_rc" + fi +} + # **** Parse command line **** getopt=$(getopt -s bash -o 'nfu:' \ @@ -313,6 +335,19 @@ if ! [ "x$upstream_tag" = "x" ] \ "upstream tag $upstream_tag is not an ancestor of $branch; probably a mistake" fi +# ---- Upstream tag tree nonidentical + +case "$quilt_mode" in + gbp) + check_treesame "$upstream_tag" "$branch" ':!debian' ':!**.gitignore' \ + || fail_check_upstream_nonidentical + ;; + unapplied) + check_treesame "$upstream_tag" "$branch" ':!debian' \ + || fail_check_upstream_nonidentical + ;; +esac + # ---- Summary if $failed_check; then |