@@ -53,7 +53,12 @@ lazy_static! {
53
53
/// The status of a commit, indicating whether it needs to be updated remotely.
54
54
#[ derive( Clone , Debug ) ]
55
55
pub enum SubmitStatus {
56
- /// The commit exists locally but has not been pushed remotely.
56
+ /// The commit exists locally and there is no intention to push it to the
57
+ /// remote.
58
+ Local ,
59
+
60
+ /// The commit exists locally and will eventually be pushed to the remote,
61
+ /// but it has not been pushed yet.
57
62
Unsubmitted ,
58
63
59
64
/// It could not be determined whether the remote commit exists.
@@ -273,14 +278,25 @@ fn submit(
273
278
let statuses = try_exit_code ! ( forge. query_status( commit_set) ?) ;
274
279
debug ! ( ?statuses, "Commit statuses" ) ;
275
280
276
- let ( unsubmitted_commits, commits_to_update, commits_to_skip) : (
281
+ #[ allow( clippy:: type_complexity) ]
282
+ let ( _local_commits, unsubmitted_commits, commits_to_update, commits_to_skip) : (
283
+ HashMap < NonZeroOid , CommitStatus > ,
277
284
HashMap < NonZeroOid , CommitStatus > ,
278
285
HashMap < NonZeroOid , CommitStatus > ,
279
286
HashMap < NonZeroOid , CommitStatus > ,
280
287
) = statuses. into_iter ( ) . fold ( Default :: default ( ) , |acc, elem| {
281
- let ( mut unsubmitted, mut to_update, mut to_skip) = acc;
288
+ let ( mut local , mut unsubmitted, mut to_update, mut to_skip) = acc;
282
289
let ( commit_oid, commit_status) = elem;
283
290
match commit_status {
291
+ CommitStatus {
292
+ submit_status : SubmitStatus :: Local ,
293
+ remote_name : _,
294
+ local_branch_name : _,
295
+ remote_branch_name : _,
296
+ } => {
297
+ local. insert ( commit_oid, commit_status) ;
298
+ }
299
+
284
300
CommitStatus {
285
301
submit_status : SubmitStatus :: Unsubmitted ,
286
302
remote_name : _,
@@ -322,7 +338,7 @@ fn submit(
322
338
remote_branch_name : _,
323
339
} => { }
324
340
}
325
- ( unsubmitted, to_update, to_skip)
341
+ ( local , unsubmitted, to_update, to_skip)
326
342
} ) ;
327
343
328
344
let ( created_branches, uncreated_branches) : ( BTreeSet < String > , BTreeSet < String > ) = {
0 commit comments