path: root/
diff options
authorShawn O. Pearce <>2008-09-29 18:04:20 (GMT)
committerShawn O. Pearce <>2008-09-29 18:04:20 (GMT)
commit9800c0df412869c7949935b61581b9361fc49bd1 (patch)
tree837cb43f80452126e46ff5de641f14b7b349484f /
parent9ba929ed652f5ed7707f1c684999af4ad02c4925 (diff)
parent5a139ba483efea47e103fef47afe87157e3bba77 (diff)
Merge branch 'bc/master-diff-hunk-header-fix'
* bc/master-diff-hunk-header-fix: Clarify commit error message for unmerged files Use strchrnul() instead of strchr() plus manual workaround Use remove_path from dir.c instead of own implementation Add remove_path: a function to remove as much as possible of a path git-submodule: Fix "Unable to checkout" for the initial 'update' Clarify how the user can satisfy stash's 'dirty state' check. t4018-diff-funcname: test syntax of builtin xfuncname patterns t4018-diff-funcname: test syntax of builtin xfuncname patterns make "git remote" report multiple URLs diff hunk pattern: fix misconverted "\{" tex macro introducers diff: fix "multiple regexp" semantics to find hunk header comment diff: use extended regexp to find hunk headers diff: use extended regexp to find hunk headers diff.*.xfuncname which uses "extended" regex's for hunk header selection diff.c: associate a flag with each pattern and use it for compiling regex diff.c: return pattern entry pointer rather than just the hunk header pattern Conflicts: builtin-merge-recursive.c t/ xdiff-interface.h
Diffstat (limited to '')
1 files changed, 7 insertions, 2 deletions
diff --git a/ b/
index 92be0fe..65178ae 100755
--- a/
+++ b/
@@ -194,7 +194,7 @@ cmd_add()
module_clone "$path" "$realrepo" || exit
- (unset GIT_DIR; cd "$path" && git checkout -q ${branch:+-b "$branch" "origin/$branch"}) ||
+ (unset GIT_DIR; cd "$path" && git checkout -f -q ${branch:+-b "$branch" "origin/$branch"}) ||
die "Unable to checkout submodule '$path'"
@@ -340,8 +340,13 @@ cmd_update()
if test "$subsha1" != "$sha1"
+ force=
+ if test -z "$subsha1"
+ then
+ force="-f"
+ fi
(unset GIT_DIR; cd "$path" && git-fetch &&
- git-checkout -q "$sha1") ||
+ git-checkout $force -q "$sha1") ||
die "Unable to checkout '$sha1' in submodule path '$path'"
say "Submodule path '$path': checked out '$sha1'"