Server IP : 127.0.0.2 / Your IP : 3.17.141.114 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/lib/git-core/ |
Upload File : |
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # # Resolve two or more trees. # LF=' ' die () { echo >&2 "$*" exit 1 } # The first parameters up to -- are merge bases; the rest are heads. bases= head= remotes= sep_seen= for arg do case ",$sep_seen,$head,$arg," in *,--,) sep_seen=yes ;; ,yes,,*) head=$arg ;; ,yes,*) remotes="$remotes$arg " ;; *) bases="$bases$arg " ;; esac done # Reject if this is not an Octopus -- resolve should be used instead. case "$remotes" in ?*' '?*) ;; *) exit 2 ;; esac # MRC is the current "merge reference commit" # MRT is the current "merge result tree" MRC=$(git rev-parse --verify -q $head) MRT=$(git write-tree) NON_FF_MERGE=0 OCTOPUS_FAILURE=0 for SHA1 in $remotes do case "$OCTOPUS_FAILURE" in 1) # We allow only last one to have a hand-resolvable # conflicts. Last round failed and we still had # a head to merge. echo "Automated merge did not work." echo "Should not be doing an Octopus." exit 2 esac eval pretty_name=\${GITHEAD_$SHA1:-$SHA1} if test "$SHA1" = "$pretty_name" then SHA1_UP="$(echo "$SHA1" | tr a-z A-Z)" eval pretty_name=\${GITHEAD_$SHA1_UP:-$pretty_name} fi common=$(git merge-base --all $SHA1 $MRC) || die "Unable to find common commit with $pretty_name" case "$LF$common$LF" in *"$LF$SHA1$LF"*) echo "Already up-to-date with $pretty_name" continue ;; esac if test "$common,$NON_FF_MERGE" = "$MRC,0" then # The first head being merged was a fast-forward. # Advance MRC to the head being merged, and use that # tree as the intermediate result of the merge. # We still need to count this as part of the parent set. echo "Fast-forwarding to: $pretty_name" git read-tree -u -m $head $SHA1 || exit MRC=$SHA1 MRT=$(git write-tree) continue fi NON_FF_MERGE=1 echo "Trying simple merge with $pretty_name" git read-tree -u -m --aggressive $common $MRT $SHA1 || exit 2 next=$(git write-tree 2>/dev/null) if test $? -ne 0 then echo "Simple merge did not work, trying automatic merge." git-merge-index -o git-merge-one-file -a || OCTOPUS_FAILURE=1 next=$(git write-tree 2>/dev/null) fi MRC="$MRC $SHA1" MRT=$next done exit "$OCTOPUS_FAILURE"