File: avoid-null-cd.patch

package info (click to toggle)
git-dpm 0.10.0-1.2
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 948 kB
  • sloc: sh: 7,302; makefile: 76
file content (19 lines) | stat: -rw-r--r-- 512 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Description: Avoid calling cd with an empty argument
 Fixes incompatibility with bash 5.3.
Author: Colin Watson <cjwatson@debian.org>
Bug-Debian: https://bugs.debian.org/1115226
Last-Update: 2025-09-16

--- git-dpm-0.10.0.orig/git-dpm.sh
+++ git-dpm-0.10.0/git-dpm.sh
@@ -238,7 +238,9 @@ function checkworkingdir() {
 function cdtoplevel() {
 	test -n "$gitdir" || return 1
 	checkworkingdir || return 1
-	cd -- "$reldir" || return 1
+	if [ "$reldir" ]; then
+		cd -- "$reldir" || return 1
+	fi
 	reldir=""
 }