Skip to content

Commit 9c41b79

Browse files
feat: Added prune & pruneTags parameter to pull command
1 parent 9dacfe2 commit 9c41b79

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "git-essentials",
3-
"version": "0.3.23",
3+
"version": "0.3.24",
44
"description": "The essential GIT commands",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/api/pull.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ type PullParams = {
6363
/** The name of the branch on the remote to fetch. By default this is the configured remote tracking branch. */
6464
remoteRef?: string
6565

66+
/** Delete local remote-tracking branches that are not present on the remote. */
67+
prune?: boolean
68+
69+
/** Prune local tags that don’t exist on the remote, and force-update those tags that differ. */
70+
pruneTags?: boolean
71+
6672
/** If false, only create merge commits (default: `true`). */
6773
fastForward?: boolean
6874

@@ -121,6 +127,8 @@ export async function pull({
121127
url,
122128
remote,
123129
remoteRef,
130+
prune = false,
131+
pruneTags = false,
124132
fastForward = true,
125133
fastForwardOnly = false,
126134
singleBranch,
@@ -163,13 +171,15 @@ export async function pull({
163171
url,
164172
remote,
165173
remoteRef,
174+
prune,
175+
pruneTags,
166176
fastForward,
167177
fastForwardOnly,
168178
singleBranch,
169179
headers,
170180
author,
171181
committer,
172-
signingKey,
182+
signingKey
173183
})
174184
} catch (err: any) {
175185
err.caller = 'git.pull'

src/commands/pull.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ type PullParams = {
3434
url?: string
3535
remote?: string
3636
remoteRef?: string
37+
prune?: boolean
38+
pruneTags?: boolean
3739
fastForward: boolean
3840
fastForwardOnly: boolean
3941
singleBranch?: boolean
@@ -65,6 +67,8 @@ export async function _pull({
6567
url,
6668
remote,
6769
remoteRef,
70+
prune = false,
71+
pruneTags = false,
6872
fastForward,
6973
fastForwardOnly,
7074
singleBranch,
@@ -100,6 +104,8 @@ export async function _pull({
100104
remoteRef,
101105
singleBranch,
102106
headers,
107+
prune,
108+
pruneTags
103109
})
104110
// Merge the remote tracking branch into the local one.
105111
await _merge({

0 commit comments

Comments
 (0)