Skip to content

Commit 2b207d9

Browse files
author
certcc-ghbot
committed
Merge remote-tracking branch 'upstream/main'
2 parents 04462d7 + e947b3f commit 2b207d9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

searchsploit

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,18 +241,21 @@ function updategit() {
241241
git checkout -- . 2>/dev/null \
242242
|| sudo git checkout -- .
243243

244+
# Get origin branch name
245+
origin_branch=$(git branch -l master main | sed 's/^* //')
246+
244247
# Update from git
245248
echo -e "\n[i] Git pull'ing"
246-
git pull -v upstream master 2>/dev/null \
247-
|| sudo git pull -v upstream master
249+
git pull -v upstream $origin_branch 2>/dev/null \
250+
|| sudo git pull -v upstream $origin_branch
248251

249252
# If conflicts, clean and try again
250253
if [[ "$?" -ne 0 ]]; then
251254
echo -e "\n[-] Git conflict"
252255
git clean -d -fx "" \
253256
|| sudo git clean -d -fx ""
254-
git pull -v upstream master \
255-
|| sudo git pull -v upstream master
257+
git pull -v upstream $origin_branch \
258+
|| sudo git pull -v upstream $origin_branch
256259
fi
257260

258261
echo -e "\n[*] Git update finished"

0 commit comments

Comments
 (0)