File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -102,9 +102,8 @@ fn run(matches: &ArgMatches) -> Result<()> {
102
102
. map_err ( |_| anyhow ! ( "Invalid committish `{committish}`" ) ) ?;
103
103
104
104
let mut target_commit = target_object
105
- . peel ( git2:: ObjectType :: Commit ) . ok ( )
106
- . and_then ( |c| c. into_commit ( ) . ok ( ) )
107
- . ok_or_else ( || anyhow ! ( "Target `{committish}` cannot be evaluated as a commit" ) ) ?;
105
+ . peel_to_commit ( )
106
+ . map_err ( |_| anyhow ! ( "Target `{committish}` does not resolve to a commit" ) ) ?;
108
107
109
108
let bases = repo. merge_bases ( target_commit. id ( ) , stack. base ( ) . id ( ) ) ?;
110
109
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ test_expect_success 'Uncommit when top != head' '
145
145
146
146
test_expect_success ' Uncommit to something that does not resolve to a commit' '
147
147
command_error stg uncommit --to HEAD^{tree} 2>err &&
148
- grep -e "error: Target \`HEAD^{tree}\` cannot be evaluated as a commit" err
148
+ grep -e "error: Target \`HEAD^{tree}\` does not resolve to a commit" err
149
149
'
150
150
151
151
test_expect_success ' Uncommit to an annotated tag' '
You can’t perform that action at this time.
0 commit comments