Skip to content

Commit 73b4da1

Browse files
committed
fix(push): defer PR to ensure GitHub has registered the new commit
1 parent 14cfa7e commit 73b4da1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ require("tinygit").push {
349349
forceWithLease = false,
350350
createGitHubPr = false,
351351
}
352-
require("tinygit").createGitHubPr()
352+
require("tinygit").createGitHubPr() -- to push before, use `.push { createGitHubPr = true }`
353353
```
354354

355355
### File history

lua/tinygit/commands/push-pull.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,11 @@ local function pushCmd(opts)
6060
if config.openReferencedIssues and not opts.forceWithLease then
6161
openReferencedIssues(commitRange)
6262
end
63-
if opts.createGitHubPr then createGitHubPr() end
6463
updateStatusline()
64+
if opts.createGitHubPr then
65+
-- deferred to ensrue GitHub has registered the PR
66+
vim.defer_fn(createGitHubPr, 1000)
67+
end
6568
end)
6669
)
6770
end

0 commit comments

Comments
 (0)