File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ $winrtNuspecFile = "$root\UnitsNet.WindowsRuntimeComponent\UnitsNet.WindowsRunti
61
61
$newVersion = Get-NewProjectVersion $projFile $paramSet $setVersion $bumpVersion
62
62
63
63
# Reset and stash any other local changes.
64
- Invoke-StashPush
64
+ $didStash = Invoke-StashPush
65
65
66
66
# Update project files
67
67
Set-ProjectVersion $projFile $newVersion
@@ -79,4 +79,6 @@ Invoke-CommitVersionBump @("UnitsNet") $newVersion
79
79
Invoke-TagVersionBump " UnitsNet" $newVersion
80
80
81
81
# Restore any local changes.
82
- Invoke-StashPop
82
+ if ($didStash ) {
83
+ Invoke-StashPop
84
+ }
Original file line number Diff line number Diff line change @@ -17,8 +17,11 @@ function Get-NewProjectVersion(
17
17
}
18
18
19
19
function Invoke-StashPush () {
20
+ $oldSha = $ (git rev- parse - q -- verify refs/ stash)
20
21
git reset -- quiet
21
- git stash -- include- untracked -- message " Before version bump" -- quiet
22
+ git stash push -- include- untracked -- message " Before version bump" -- quiet
23
+ $newSha = $ (git rev- parse - q -- verify refs/ stash)
24
+ return $oldSha -ne $newSha
22
25
}
23
26
24
27
function Invoke-StashPop () {
You can’t perform that action at this time.
0 commit comments