File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,6 +85,28 @@ M.repo_status = function(callback, cwd)
8585 end )
8686end
8787
88+ M .is_rebasing = function ()
89+ local handle = io.popen (" git rev-parse --git-path rebase-merge 2>/dev/null" , " r" )
90+ if handle then
91+ local result = handle :read (" *a" ):gsub (" %s+" , " " )
92+ handle :close ()
93+ if result ~= " " and vim .uv .fs_stat (result ) then
94+ return true
95+ end
96+ end
97+
98+ handle = io.popen (" git rev-parse --git-path rebase-apply 2>/dev/null" , " r" )
99+ if handle then
100+ local result = handle :read (" *a" ):gsub (" %s+" , " " )
101+ handle :close ()
102+ if result ~= " " and vim .uv .fs_stat (result ) then
103+ return true
104+ end
105+ end
106+
107+ return false
108+ end
109+
88110M .remote_status = function (callback , cwd )
89111 cwd = cwd or vim .fn .getcwd ()
90112
Original file line number Diff line number Diff line change 11-- Session management
22-- https://github.com/rmagatti/auto-session
33
4+ local is_rebasing = require (" lib.git" ).is_rebasing
5+
46return {
57 " rmagatti/auto-session" ,
68 event = " VimEnter" ,
@@ -9,6 +11,20 @@ return {
911 git_auto_restore_on_branch_change = true ,
1012 git_use_branch_name = true ,
1113 purge_after_minutes = 14400 ,
14+ pre_save_cmds = {
15+ function ()
16+ if is_rebasing () then
17+ return false
18+ end
19+ end ,
20+ },
21+ pre_restore_cmds = {
22+ function ()
23+ if is_rebasing () then
24+ return false
25+ end
26+ end ,
27+ },
1228 save_extra_cmds = {
1329 -- Save and restore the quickfix list
1430 function ()
You can’t perform that action at this time.
0 commit comments