@@ -198,6 +198,7 @@ class GitRepository
198
198
void establish_description (void );
199
199
void establish_tag (void );
200
200
void establish_state (void );
201
+ void establish_state_rebasing (void );
201
202
void establish_dirty_staged_untracked (void );
202
203
// These are static methods because otherwise, their signatures do not
203
204
// match the required signatures for use as callback functions.
@@ -310,7 +311,7 @@ void GitRepository::establish_state(void)
310
311
case C::GIT_REPOSITORY_STATE_REBASE:
311
312
case C::GIT_REPOSITORY_STATE_REBASE_INTERACTIVE:
312
313
case C::GIT_REPOSITORY_STATE_REBASE_MERGE:
313
- this ->state = " rebasing " ;
314
+ this ->establish_state_rebasing () ;
314
315
break ;
315
316
case C::GIT_REPOSITORY_STATE_REVERT:
316
317
case C::GIT_REPOSITORY_STATE_REVERT_SEQUENCE:
@@ -319,6 +320,21 @@ void GitRepository::establish_state(void)
319
320
}
320
321
}
321
322
323
+
324
+ /* *
325
+ * Obtain the rebase state of the working tree of the current Git repository.
326
+ */
327
+ void GitRepository::establish_state_rebasing (void ){
328
+ this ->state = " rebasing" ;
329
+ std::ifstream msgnum_file (this ->gitdir / " rebase-merge/msgnum" );
330
+ if (!msgnum_file.good ()){
331
+ return ;
332
+ }
333
+ std::string msgnum_contents;
334
+ msgnum_file >> msgnum_contents;
335
+ this ->state += " " + msgnum_contents;
336
+ }
337
+
322
338
/* *
323
339
* Obtain the statuses of the index and working tree of the current Git
324
340
* repository.
0 commit comments