Skip to content

Commit 7d285c0

Browse files
authored
diagnostic: Use pushd/popd in uncommited modifications nudge
While filing #20379, I lost where I was because I followed the given instruction. Instead, let's use pushd/popd so the user is returned to their pwd if the git operations succeed.
1 parent a729c53 commit 7d285c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Library/Homebrew/diagnostic.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ def check_git_status
703703
If this is a surprise to you, then you should stash these modifications.
704704
Stashing returns Homebrew to a pristine state but can be undone
705705
should you later need to do so for some reason.
706-
cd #{path} && git stash -u && git clean -d -f
706+
pushd #{path} && git stash -u && git clean -d -f && popd
707707
EOS
708708

709709
modified = status.split("\n")

0 commit comments

Comments
 (0)