From: Junio C Hamano Date: Tue, 25 Aug 2015 21:57:08 +0000 (-0700) Subject: Merge branch 'dt/notes-multiple' X-Git-Tag: v2.6.0-rc0~49 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=32561f5dd39da3ac720f6778bc2e8aafed771eb5;p=thirdparty%2Fgit.git Merge branch 'dt/notes-multiple' When linked worktree is used, simultaneous "notes merge" instances for the same ref in refs/notes/* are prevented from stomping on each other. * dt/notes-multiple: notes: handle multiple worktrees worktrees: add find_shared_symref --- 32561f5dd39da3ac720f6778bc2e8aafed771eb5 diff --cc branch.c index 3364adf182,483c52740f..d013374e5a --- a/branch.c +++ b/branch.c @@@ -302,16 -301,17 +302,17 @@@ void create_branch(const char *head void remove_branch_state(void) { - unlink(git_path("CHERRY_PICK_HEAD")); - unlink(git_path("REVERT_HEAD")); - unlink(git_path("MERGE_HEAD")); - unlink(git_path("MERGE_RR")); - unlink(git_path("MERGE_MSG")); - unlink(git_path("MERGE_MODE")); - unlink(git_path("SQUASH_MSG")); + unlink(git_path_cherry_pick_head()); + unlink(git_path_revert_head()); + unlink(git_path_merge_head()); + unlink(git_path_merge_rr()); + unlink(git_path_merge_msg()); + unlink(git_path_merge_mode()); + unlink(git_path_squash_msg()); } - static void check_linked_checkout(const char *branch, const char *id) + static char *find_linked_symref(const char *symref, const char *branch, + const char *id) { struct strbuf sb = STRBUF_INIT; struct strbuf path = STRBUF_INIT; diff --cc builtin/notes.c index 63f95fc554,b97bcb07ef..0423480827 --- a/builtin/notes.c +++ b/builtin/notes.c @@@ -19,20 -19,21 +19,21 @@@ #include "string-list.h" #include "notes-merge.h" #include "notes-utils.h" + #include "branch.h" static const char * const git_notes_usage[] = { - N_("git notes [--ref ] [list []]"), - N_("git notes [--ref ] add [-f] [-m | -F | (-c | -C) ] []"), - N_("git notes [--ref ] copy [-f] "), - N_("git notes [--ref ] append [-m | -F | (-c | -C) ] []"), - N_("git notes [--ref ] edit []"), - N_("git notes [--ref ] show []"), - N_("git notes [--ref ] merge [-v | -q] [-s ] "), + N_("git notes [--ref ] [list []]"), + N_("git notes [--ref ] add [-f] [--allow-empty] [-m | -F | (-c | -C) ] []"), + N_("git notes [--ref ] copy [-f] "), + N_("git notes [--ref ] append [--allow-empty] [-m | -F | (-c | -C) ] []"), + N_("git notes [--ref ] edit [--allow-empty] []"), + N_("git notes [--ref ] show []"), + N_("git notes [--ref ] merge [-v | -q] [-s ] "), N_("git notes merge --commit [-v | -q]"), N_("git notes merge --abort [-v | -q]"), - N_("git notes [--ref ] remove [...]"), - N_("git notes [--ref ] prune [-n | -v]"), - N_("git notes [--ref ] get-ref"), + N_("git notes [--ref ] remove [...]"), + N_("git notes [--ref ] prune [-n | -v]"), + N_("git notes [--ref ] get-ref"), NULL };