git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 6/6] git-branch: remove D/F check done by hand.

From
Junio C Hamano <junkio@cox.net>
Date
Sep 30, 2006, 22:30 UTC
Message-ID
<7v4pup9ecj.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7v1wptc7ou.fsf@assigned-by-dhcp.cox.net>

Now ref creation codepath in lock_ref_sha1() and friends notices the directory/file conflict situation, we do not do this by hand in git-branch anymore.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 git-branch.sh |   10 ----------
 1 files changed, 0 insertions(+), 10 deletions(-)
diff --git a/git-branch.sh b/git-branch.sh
index c616830..bf84b30 100755
--- a/git-branch.sh
+++ b/git-branch.sh
@@ -121,16 +121,6 @@ then
 	done
 fi
 
-branchdir=$(dirname $branchname)
-while test "$branchdir" != "."
-do
-	if git-show-ref --verify --quiet -- "refs/heads/$branchdir"
-	then
-		die "$branchdir already exists."
-	fi
-	branchdir=$(dirname $branchdir)
-done
-
 prev=''
 if git-show-ref --verify --quiet -- "refs/heads/$branchname"
 then
-- 
1.4.2.1.g5a98f
Previous: Junio C HamanoNext: Jeff King
Message 9 of 14 in “Move code resolving packed refs into its own function.”
  1. 1/2 Move code resolving packed refs into its own function.Christian Couder, Sep 30, 2006
  2. Junio C HamanoSep 30, 2006
  3. 0/6 ref deletion and D/F conflict avoidance with packed-refs.Junio C Hamano, Sep 30, 2006
  4. 1/6 ref locking: allow 'foo' when 'foo/bar' used to exist but not anymore.Junio C Hamano, Sep 30, 2006
  5. 2/6 refs: minor restructuring of cached refs data.Junio C Hamano, Sep 30, 2006
  6. 3/6 lock_ref_sha1(): do not sometimes error() and sometimes die().Junio C Hamano, Sep 30, 2006
  7. 4/6 lock_ref_sha1(): check D/F conflict with packed ref when creating.Junio C Hamano, Sep 30, 2006
  8. 5/6 delete_ref(): delete packed refJunio C Hamano, Sep 30, 2006
  9. 6/6 git-branch: remove D/F check done by hand.Junio C Hamano, Sep 30, 2006
  10. Jeff KingSep 30, 2006
  11. Christian CouderOct 1, 2006
  12. Junio C HamanoOct 1, 2006
  13. Jakub NarebskiOct 3, 2006
  14. Junio C HamanoOct 3, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.