Thread (139 messages) 139 messages, 5 authors, 2021-04-30
STALE1887d
Revisions (3)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v3 current

[PATCH v3 22/30] subtree: remove duplicate check

From: Luke Shumaker <hidden>
Date: 2021-04-27 21:18:55
Subsystem: the rest · Maintainer: Linus Torvalds

From: Luke Shumaker <redacted>

`cmd_add` starts with a check that the directory doesn't yet exist.
However, the `main` function performs the exact same check before
calling `cmd_add`.  So remove the check from `cmd_add`.

Signed-off-by: Luke Shumaker <redacted>
---
 contrib/subtree/git-subtree.sh | 4 ----
 1 file changed, 4 deletions(-)
diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 0df8d1b7d4..7fbd8481ed 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -655,10 +655,6 @@ process_split_commit () {
 }
 
 cmd_add () {
-	if test -e "$dir"
-	then
-		die "'$dir' already exists.  Cannot add."
-	fi
 
 	ensure_clean
 
-- 
2.31.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help