Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH 2/2] mergetool: Don't assume paths are unmerged

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:51:31

Jonathon Mah [off-list ref] writes:
 if test $# -eq 0 ; then
     cd_to_toplevel
 
     if test -e "$GIT_DIR/MERGE_RR"
     then
+	files=$(git rerere remaining)
+    else
+	files=$(git ls-files -u | sed -e 's/^[^	]*	//' | sort -u)
     fi
 else
     while test $# -gt 0; do
+	matches=$(git ls-files -u -- "$1" | sed -e 's/^[^	]*	//' | sort -u)
+	if test -n "$matches"; then
+	    if test -z "$files"; then
+		files=$matches
+	    else
+		files=$(printf "%s\n%s" "$files" "$matches")
+	    fi
 	fi
 	shift
     done
+    files=$(printf "%s" "$files" | sort -u)
 fi
Why do you need a loop here in the else clause, instead of just a single:

	files=$(git ls-files -u -- "$@" |...)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help