summaryrefslogtreecommitdiff
path: root/git-hooks
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>2020-05-07 21:29:38 +0200
committerOswald Buddenhagen <oswald.buddenhagen@gmx.de>2020-05-08 12:37:00 +0000
commita1b4bba07dfdb9fd65ac74feeec9babc502cb60e (patch)
treed3c7a6c30a2320758fc73dd72a5ffe2218382b01 /git-hooks
parentd6bae99c46f827a907dc3bd067bf19967cd725f8 (diff)
downloadqtrepotools-a1b4bba07dfdb9fd65ac74feeec9babc502cb60e.tar.gz
suppress stderr output of git-merge-base
when validating cherry-pick sources, we might be presented entirely unknown sha1s. don't spam stderr with the resulting error messages from git, as they are entirely expected. amends 51744f4f0. Change-Id: I9a5203ee1810ba6903eab9ad8bfb8f695e196ba5 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'git-hooks')
-rwxr-xr-xgit-hooks/sanitize-commit4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-hooks/sanitize-commit b/git-hooks/sanitize-commit
index 20f1491..bdfbd1d 100755
--- a/git-hooks/sanitize-commit
+++ b/git-hooks/sanitize-commit
@@ -367,7 +367,7 @@ sub check_cherry_pick($)
# git creates a hypothetical merge between the sources, so
# valid commits will lie in the ancestry of this merge,
# making the commit itself the best merge base.
- chomp(my $origBase = `git merge-base $orig @sources`);
+ chomp(my $origBase = `git merge-base $orig @sources 2> /dev/null`);
return if ($origBase eq $orig);
}
} else {
@@ -376,7 +376,7 @@ sub check_cherry_pick($)
complain("Cherry-picks are strongly discouraged", "cherry");
}
return if (!@allHeads); # Some truly weird repo
- chomp(my $origBase = `git merge-base $orig @allHeads`);
+ chomp(my $origBase = `git merge-base $orig @allHeads 2> /dev/null`);
if ($origBase ne $orig) {
# Most likely not integrated yet, but may also be a wip/ branch.
complain_ln("Cherry-pick's source is not an upstream commit", "cherry", 1);