path: root/
diff options
authorShawn O. Pearce <>2008-09-29 17:52:34 (GMT)
committerShawn O. Pearce <>2008-09-29 17:52:34 (GMT)
commit5a139ba483efea47e103fef47afe87157e3bba77 (patch)
tree9b387acffb4bd7b886d2a1b05e18832ad079bff9 /
parentfdac6692a0b0eda293f9f1bf4bc49b05b29f3c45 (diff)
parentedb7e82f72106add9f2fbaf9d99d9532a72e3f91 (diff)
Merge branch 'maint' into bc/master-diff-hunk-header-fix
* maint: (41 commits) 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. Remove empty directories in recursive merge Documentation: clarify the details of overriding LESS via core.pager Update release notes for checkout: Do not show local changes when in quiet mode for-each-ref: Fix --format=%(subject) for log message without newlines don't default to refs/stash if invalid ref supplied maint: check return of split_cmdline to avoid bad config strings builtin-prune.c: prune temporary packs in <object_dir>/pack directory Do not perform cross-directory renames when creating packs Use dashless git commands in setgitperms.perl git-remote: do not use user input in a printf format string make "git remote" report multiple URLs Start draft release notes for git-repack uses --no-repack-object, not --no-repack-delta. ... Conflicts: RelNotes
Diffstat (limited to '')
1 files changed, 7 insertions, 2 deletions
diff --git a/ b/
index 1c39b59..c3d0d24 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'"