mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
hooks: bypass more hooks for push-redirected pushes
Summary: Until we have the same standards for the native and push-redirected pushes, these need to be automatically bypassed. Reviewed By: krallin Differential Revision: D24357372 fbshipit-source-id: f85459145f6a5217c07445d7017f3b11ed1284a7
This commit is contained in:
parent
1e9fd313ad
commit
7af104b330
@ -80,8 +80,13 @@ impl ChangesetHook for LimitCommitsize {
|
||||
_bookmark: &BookmarkName,
|
||||
changeset: &'cs BonsaiChangeset,
|
||||
_content_fetcher: &'fetcher dyn FileContentFetcher,
|
||||
_cross_repo_push_source: CrossRepoPushSource,
|
||||
cross_repo_push_source: CrossRepoPushSource,
|
||||
) -> Result<HookExecution> {
|
||||
if cross_repo_push_source == CrossRepoPushSource::PushRedirected {
|
||||
// For push-redirected commits, we rely on running source-repo hooks
|
||||
return Ok(HookExecution::Accepted);
|
||||
}
|
||||
|
||||
let mut totalsize = 0;
|
||||
for (path, file_change) in changeset.file_changes() {
|
||||
let file = match file_change {
|
||||
|
@ -77,8 +77,13 @@ impl FileHook for LimitFilesize {
|
||||
content_fetcher: &'fetcher dyn FileContentFetcher,
|
||||
change: Option<&'change FileChange>,
|
||||
path: &'path MPath,
|
||||
_cross_repo_push_source: CrossRepoPushSource,
|
||||
cross_repo_push_source: CrossRepoPushSource,
|
||||
) -> Result<HookExecution> {
|
||||
if cross_repo_push_source == CrossRepoPushSource::PushRedirected {
|
||||
// For push-redirected commits, we rely on running source-repo hooks
|
||||
return Ok(HookExecution::Accepted);
|
||||
}
|
||||
|
||||
let path = format!("{}", path);
|
||||
if self
|
||||
.ignore_path_regexes
|
||||
|
@ -81,8 +81,13 @@ impl FileHook for NoQuestionableFilenames {
|
||||
_content_fetcher: &'fetcher dyn FileContentFetcher,
|
||||
change: Option<&'change FileChange>,
|
||||
path: &'path MPath,
|
||||
_cross_repo_push_source: CrossRepoPushSource,
|
||||
cross_repo_push_source: CrossRepoPushSource,
|
||||
) -> Result<HookExecution> {
|
||||
if cross_repo_push_source == CrossRepoPushSource::PushRedirected {
|
||||
// For push-redirected pushes we rely on the hook
|
||||
// running in the original repo
|
||||
return Ok(HookExecution::Accepted);
|
||||
}
|
||||
if change.is_none() {
|
||||
return Ok(HookExecution::Accepted);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user