File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ branch_type=""
5757some_remote=" "
5858ref_ff_to_ref=" "
5959ref_strict_ff_to_ref=" "
60+ submodule=" "
61+ conflict=" "
6062for folder in " $@ "
6163do
6264 if [ -z " $options " ]; then
164166 shift
165167 ref_strict_ff_to_ref=` echo -n " $folder " | cut -c24-`
166168 continue
169+ elif [ " $folder " = " --submodule" ]; then
170+ shift
171+ submodule=" 1"
172+ continue
173+ elif [ " $folder " = " --not-submodule" ]; then
174+ shift
175+ submodule=" 0"
176+ continue
177+ elif [ " $folder " = " --conflict" ]; then
178+ shift
179+ conflict=" 1"
180+ continue
181+ elif [ " $folder " = " --no-conflict" ]; then
182+ shift
183+ conflict=" 0"
184+ continue
167185 fi
168186 fi
169187 options=" 1"
449467 continue
450468 fi
451469 fi
470+ if [ -n " $conflict " ]; then
471+ status=$( LANG=" en" git -C " $OLDPWD " status --short -- " $git_folder " | cut -d' ' -f1)
472+ if [ " $status " = " UU" -a " $conflict " = " 0" ]; then
473+ cd " $OLDPWD "
474+ continue
475+ elif [ " $status " != " UU" -a " $conflict " = " 1" ]; then
476+ cd " $OLDPWD "
477+ continue
478+ fi
479+ fi
480+ if [ -n " $submodule " ]; then
481+ if ! git -C " $OLDPWD " branch > /dev/null 2>&1 ; then
482+ cd " $OLDPWD "
483+ continue
484+ fi
485+ status=$( LANG=" en" git -C " $OLDPWD " ls-files --cached --stage --full-name -- " $git_folder " | cut -d' ' -f1)
486+ if [ " $status " = " 160000" -a " $submodule " = " 0" ]; then
487+ cd " $OLDPWD "
488+ continue
489+ elif [ " $status " != " 160000" -a " $submodule " = " 1" ]; then
490+ cd " $OLDPWD "
491+ continue
492+ fi
493+ fi
452494 if [ " $display_only " = " true" ]; then
453495 echo " $git_folder "
454496 cd " $OLDPWD "
You can’t perform that action at this time.
0 commit comments