-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make invocation recorder not require a repo
Summary: Will be used in the next diff so there is no dependency of log commands to repo Reviewed By: iguridi Differential Revision: D64153503 fbshipit-source-id: 12d8d4ed2061c92995b7614cf5212efcf8a6673d
- Loading branch information
1 parent
ca3ccae
commit 78eafb4
Showing
6 changed files
with
108 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under both the MIT license found in the | ||
* LICENSE-MIT file in the root directory of this source tree and the Apache | ||
* License, Version 2.0 found in the LICENSE-APACHE file in the root directory | ||
* of this source tree. | ||
*/ | ||
|
||
use crate::invocation_paths::InvocationPaths; | ||
|
||
#[derive(Clone)] | ||
pub enum InvocationPathsResult { | ||
OtherError(buck2_error::Error), | ||
Paths(InvocationPaths), | ||
OutsideOfRepo(buck2_error::Error), // this error ignored for creating invocation record for log commands | ||
} | ||
|
||
impl InvocationPathsResult { | ||
pub fn get_result(self) -> anyhow::Result<InvocationPaths> { | ||
match self { | ||
InvocationPathsResult::OtherError(e) => Err(e.into()), | ||
InvocationPathsResult::Paths(paths) => Ok(paths), | ||
InvocationPathsResult::OutsideOfRepo(e) => Err(e.into()), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters