@@ -3207,49 +3207,15 @@ fn advanced_workspace_multi_stack() -> anyhow::Result<()> {
3207
3207
add_stack_with_segments ( & mut meta, 1 , "B" , StackState :: InWorkspace , & [ ] ) ;
3208
3208
3209
3209
let opts = standard_options ( ) ;
3210
- let info = head_info ( & repo, & meta, opts) ?;
3211
- // It can find the exact location of the workspace commit in the ancestry.
3212
- insta:: assert_debug_snapshot!( info, @r#"
3213
- RefInfo {
3214
- workspace_ref_name: Some(
3215
- FullName(
3216
- "refs/heads/gitbutler/workspace",
3217
- ),
3218
- ),
3219
- stacks: [],
3220
- target: Some(
3221
- Target {
3222
- ref_name: FullName(
3223
- "refs/remotes/origin/main",
3224
- ),
3225
- segment_index: NodeIndex(1),
3226
- commits_ahead: 0,
3227
- },
3228
- ),
3229
- extra_target: Some(
3230
- NodeIndex(1),
3231
- ),
3232
- lower_bound: Some(
3233
- NodeIndex(2),
3234
- ),
3235
- is_managed_ref: true,
3236
- is_managed_commit: false,
3237
- ancestor_workspace_commit: Some(
3238
- AncestorWorkspaceCommit {
3239
- commits_outside: [
3240
- Commit(a7131b1, "on-top4\n"🏘️),
3241
- Commit(4d3831e, "on-top3\n"🏘️),
3242
- Commit(468357f, "on-top2-merge\n"🏘️),
3243
- Commit(d3166f7, "on-top-sibling\n"🏘️),
3244
- Commit(118ddbb, "on-top1\n"🏘️),
3245
- ],
3246
- segment_with_managed_commit: NodeIndex(10),
3247
- commit_index_of_managed_commit: 0,
3248
- },
3249
- ),
3250
- is_entrypoint: true,
3251
- }
3252
- "# ) ;
3210
+ let err = head_info ( & repo, & meta, opts) . unwrap_err ( ) ;
3211
+ insta:: assert_snapshot!( err. to_string( ) , @r"
3212
+ Found 5 commit(s) on top of the workspace commit.
3213
+
3214
+ The current changes will be stashed and must be re-applied manually. Commit them otherwise.
3215
+ Run the following command in your working directory to fix this and restore the committed changes.
3216
+
3217
+ git stash && git reset --hard 619d5486e6f5ae7f5e4ecc4a6ea506d6c8433410 && git checkout a7131b181b20c699ecbe4f6145bbb8746716c18b -- .
3218
+ " ) ;
3253
3219
Ok ( ( ) )
3254
3220
}
3255
3221
@@ -3273,49 +3239,15 @@ fn advanced_workspace_single_stack() -> anyhow::Result<()> {
3273
3239
add_stack_with_segments ( & mut meta, 0 , "A" , StackState :: InWorkspace , & [ ] ) ;
3274
3240
3275
3241
let opts = standard_options ( ) ;
3276
- let info = head_info ( & repo, & meta, opts) ?;
3277
- // It can find the exact location of the workspace commit in the ancestry.
3278
- insta:: assert_debug_snapshot!( info, @r#"
3279
- RefInfo {
3280
- workspace_ref_name: Some(
3281
- FullName(
3282
- "refs/heads/gitbutler/workspace",
3283
- ),
3284
- ),
3285
- stacks: [],
3286
- target: Some(
3287
- Target {
3288
- ref_name: FullName(
3289
- "refs/remotes/origin/main",
3290
- ),
3291
- segment_index: NodeIndex(1),
3292
- commits_ahead: 0,
3293
- },
3294
- ),
3295
- extra_target: Some(
3296
- NodeIndex(1),
3297
- ),
3298
- lower_bound: Some(
3299
- NodeIndex(2),
3300
- ),
3301
- is_managed_ref: true,
3302
- is_managed_commit: false,
3303
- ancestor_workspace_commit: Some(
3304
- AncestorWorkspaceCommit {
3305
- commits_outside: [
3306
- Commit(da912a8, "on-top4\n"🏘️),
3307
- Commit(198eaf8, "on-top3\n"🏘️),
3308
- Commit(3147997, "on-top2-merge\n"🏘️),
3309
- Commit(dd7bb9a, "on-top-sibling\n"🏘️),
3310
- Commit(9785229, "on-top1\n"🏘️),
3311
- ],
3312
- segment_with_managed_commit: NodeIndex(7),
3313
- commit_index_of_managed_commit: 1,
3314
- },
3315
- ),
3316
- is_entrypoint: true,
3317
- }
3318
- "# ) ;
3242
+ let err = head_info ( & repo, & meta, opts) . unwrap_err ( ) ;
3243
+ insta:: assert_snapshot!( err. to_string( ) , @r"
3244
+ Found 5 commit(s) on top of the workspace commit.
3245
+
3246
+ The current changes will be stashed and must be re-applied manually. Commit them otherwise.
3247
+ Run the following command in your working directory to fix this and restore the committed changes.
3248
+
3249
+ git stash && git reset --hard c58f15768a8ba280fe773ffc4820b13ad882cd84 && git checkout da912a8a455bca9e94ed65cb42328177fa891081 -- .
3250
+ " ) ;
3319
3251
Ok ( ( ) )
3320
3252
}
3321
3253
0 commit comments