Merge branch 'xXxsomebodyoncetoldmexXx-main-patch-73439' into 'main'
Fixing "fatal: couldn't find remote ref master" error for new installer. See merge request exploit-database/exploitdb!1
This commit is contained in:
commit
e947b3fe8d
1 changed files with 7 additions and 4 deletions
11
searchsploit
11
searchsploit
|
@ -241,18 +241,21 @@ function updategit() {
|
|||
git checkout -- . 2>/dev/null \
|
||||
|| sudo git checkout -- .
|
||||
|
||||
# Get origin branch name
|
||||
origin_branch=$(git branch -l master main | sed 's/^* //')
|
||||
|
||||
# Update from git
|
||||
echo -e "\n[i] Git pull'ing"
|
||||
git pull -v upstream master 2>/dev/null \
|
||||
|| sudo git pull -v upstream master
|
||||
git pull -v upstream $origin_branch 2>/dev/null \
|
||||
|| sudo git pull -v upstream $origin_branch
|
||||
|
||||
# If conflicts, clean and try again
|
||||
if [[ "$?" -ne 0 ]]; then
|
||||
echo -e "\n[-] Git conflict"
|
||||
git clean -d -fx "" \
|
||||
|| sudo git clean -d -fx ""
|
||||
git pull -v upstream master \
|
||||
|| sudo git pull -v upstream master
|
||||
git pull -v upstream $origin_branch \
|
||||
|| sudo git pull -v upstream $origin_branch
|
||||
fi
|
||||
|
||||
echo -e "\n[*] Git update finished"
|
||||
|
|
Loading…
Add table
Reference in a new issue